From 1240da3750ce726ca9ddadcd13ccc2e238b06fe0 Mon Sep 17 00:00:00 2001 From: Kit Yan Choi Date: Tue, 12 Jan 2021 09:33:23 +0000 Subject: [PATCH 1/7] Add GitHub workflow just for osx and windows --- .github/workflows/test-with-edm.yml | 40 +++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 .github/workflows/test-with-edm.yml diff --git a/.github/workflows/test-with-edm.yml b/.github/workflows/test-with-edm.yml new file mode 100644 index 000000000..2bf6077e4 --- /dev/null +++ b/.github/workflows/test-with-edm.yml @@ -0,0 +1,40 @@ +# This workflow targets stable released dependencies from EDM. + +name: Test with EDM + +on: push + +env: + INSTALL_EDM_VERSION: 3.2.1 + +jobs: + + # Test against EDM packages on Windows and OSX + test-with-edm: + strategy: + matrix: + os: [macos-latest, windows-latest] + toolkit: ['pyqt', 'pyqt5', 'pyside2', 'wx'] + runs-on: ${{ matrix.os }} + env: + # Set root directory for Windows, otherwise 'pip install ' + # complains because the Python environment is in C: drive whereas + # the source is checked out in D: drive. + EDM_ROOT_DIRECTORY: ${{ github.workspace }}/.edm + steps: + - uses: actions/checkout@v2 + - name: Cache EDM packages + uses: actions/cache@v2 + with: + path: ~/.cache + key: ${{ runner.os }}--${{ hashFiles('ci/edmtool.py') }} + - name: Setup EDM + uses: enthought/setup-edm-action@v1 + with: + edm-version: ${{ env.INSTALL_EDM_VERSION }} + - name: Install click to the default EDM environment + run: edm --config ci/.edm.yaml install -y wheel click coverage + - name: Install test environment + run: edm run -- python ci/edmtool.py install --toolkit=${{ matrix.toolkit }} + - name: Run tests + run: edm run -- python ci/edmtool.py test --toolkit=${{ matrix.toolkit }} From 8ab37f72832f209729374fef53d2d8c75602615b Mon Sep 17 00:00:00 2001 From: Kit Yan Choi Date: Tue, 12 Jan 2021 09:36:56 +0000 Subject: [PATCH 2/7] Remove Windows for now - keep it focused --- .github/workflows/test-with-edm.yml | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/.github/workflows/test-with-edm.yml b/.github/workflows/test-with-edm.yml index 2bf6077e4..95ac49fd7 100644 --- a/.github/workflows/test-with-edm.yml +++ b/.github/workflows/test-with-edm.yml @@ -9,18 +9,13 @@ env: jobs: - # Test against EDM packages on Windows and OSX + # Test against EDM packages test-with-edm: strategy: matrix: - os: [macos-latest, windows-latest] + os: [macos-latest] toolkit: ['pyqt', 'pyqt5', 'pyside2', 'wx'] runs-on: ${{ matrix.os }} - env: - # Set root directory for Windows, otherwise 'pip install ' - # complains because the Python environment is in C: drive whereas - # the source is checked out in D: drive. - EDM_ROOT_DIRECTORY: ${{ github.workspace }}/.edm steps: - uses: actions/checkout@v2 - name: Cache EDM packages From 59894d51a59cc0a8fe598d2fce60ed4c5c4d280d Mon Sep 17 00:00:00 2001 From: Kit Yan Choi Date: Tue, 12 Jan 2021 09:39:08 +0000 Subject: [PATCH 3/7] Expand comment --- .github/workflows/test-with-edm.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/test-with-edm.yml b/.github/workflows/test-with-edm.yml index 95ac49fd7..38a0c304e 100644 --- a/.github/workflows/test-with-edm.yml +++ b/.github/workflows/test-with-edm.yml @@ -10,6 +10,8 @@ env: jobs: # Test against EDM packages + # Note that some packages may not actually be installed from EDM but from + # PyPI, see ci/edmtool.py implementations. test-with-edm: strategy: matrix: From c3fba8bf0b093bb9caa375cc4140a649dea68ae7 Mon Sep 17 00:00:00 2001 From: Kit Yan Choi Date: Tue, 12 Jan 2021 10:58:45 +0000 Subject: [PATCH 4/7] Switch to pull_request trigger --- .github/workflows/test-with-edm.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-with-edm.yml b/.github/workflows/test-with-edm.yml index 38a0c304e..f229c97ae 100644 --- a/.github/workflows/test-with-edm.yml +++ b/.github/workflows/test-with-edm.yml @@ -2,7 +2,7 @@ name: Test with EDM -on: push +on: pull_request env: INSTALL_EDM_VERSION: 3.2.1 From 6ef3247bce7fa8b2ccc113f5a63eb0595f31c752 Mon Sep 17 00:00:00 2001 From: Kit Yan Choi Date: Tue, 12 Jan 2021 11:18:52 +0000 Subject: [PATCH 5/7] Add toolkit to the cache hash key --- .github/workflows/test-with-edm.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-with-edm.yml b/.github/workflows/test-with-edm.yml index f229c97ae..a4266667d 100644 --- a/.github/workflows/test-with-edm.yml +++ b/.github/workflows/test-with-edm.yml @@ -24,7 +24,7 @@ jobs: uses: actions/cache@v2 with: path: ~/.cache - key: ${{ runner.os }}--${{ hashFiles('ci/edmtool.py') }} + key: ${{ runner.os }}-${{ runner.toolkit }}-${{ hashFiles('ci/edmtool.py') }} - name: Setup EDM uses: enthought/setup-edm-action@v1 with: From a6ba3b4169c5f5e138f09599b51987a76b4f55ed Mon Sep 17 00:00:00 2001 From: Kit Yan Choi Date: Tue, 12 Jan 2021 11:35:29 +0000 Subject: [PATCH 6/7] Why isn't the cache key refreshed? From a3cb3121f599052314c9f58c9701a94b27fb06d8 Mon Sep 17 00:00:00 2001 From: Kit Yan Choi Date: Tue, 12 Jan 2021 11:37:03 +0000 Subject: [PATCH 7/7] Because... the context name was wrong so the value was empty :( --- .github/workflows/test-with-edm.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-with-edm.yml b/.github/workflows/test-with-edm.yml index a4266667d..68a44cf63 100644 --- a/.github/workflows/test-with-edm.yml +++ b/.github/workflows/test-with-edm.yml @@ -24,7 +24,7 @@ jobs: uses: actions/cache@v2 with: path: ~/.cache - key: ${{ runner.os }}-${{ runner.toolkit }}-${{ hashFiles('ci/edmtool.py') }} + key: ${{ runner.os }}-${{ matrix.toolkit }}-${{ hashFiles('ci/edmtool.py') }} - name: Setup EDM uses: enthought/setup-edm-action@v1 with: