From 9966ada501b20ad609a52ec702d36cde61b77b7a Mon Sep 17 00:00:00 2001 From: Aaron Ayres Date: Mon, 14 Jun 2021 14:55:51 -0500 Subject: [PATCH 1/3] port CI to gh-actions --- .github/workflows/ets-from-source.yml | 67 ++++++++++++++++++++++++++ .github/workflows/test-with-edm.yml | 69 +++++++++++++++++++++++++++ 2 files changed, 136 insertions(+) create mode 100644 .github/workflows/ets-from-source.yml create mode 100644 .github/workflows/test-with-edm.yml diff --git a/.github/workflows/ets-from-source.yml b/.github/workflows/ets-from-source.yml new file mode 100644 index 000000000..1a9a09cfa --- /dev/null +++ b/.github/workflows/ets-from-source.yml @@ -0,0 +1,67 @@ +name: Test with EDM using ETS packages from source + +on: + schedule: + - cron: '0 0 * * 5' + +env: + INSTALL_EDM_VERSION: 3.2.3 + +jobs: + + # Test against EDM packages + test-with-edm: + strategy: + matrix: + os: [ubuntu-latest, macos-latest, windows-latest] + toolkit: ['wx', 'pyqt5', 'pyside2'] + runs-on: ${{ matrix.os }} + env: + # Set root directory, mainly for Windows, so that the EDM Python + # environment lives in the same drive as the cloned source. Otherwise + # 'pip install' raises an error while trying to compute + # relative path between the site-packages and the source directory. + EDM_ROOT_DIRECTORY: ${{ github.workspace }}/.edm + steps: + - uses: actions/checkout@v2 + - name: Install Qt dependencies for Linux + run: | + sudo apt-get update + sudo apt-get install qt5-default + sudo apt-get install libxkbcommon-x11-0 + sudo apt-get install libxcb-icccm4 + sudo apt-get install libxcb-image0 + sudo apt-get install libxcb-keysyms1 + sudo apt-get install libxcb-randr0 + sudo apt-get install libxcb-render-util0 + sudo apt-get install libxcb-xinerama0 + sudo apt-get install pulseaudio + sudo apt-get install libpulse-mainloop-glib0 + shell: bash + if: startsWith(matrix.os, 'ubuntu') && matrix.toolkit != 'wx' + - name: Install Wx dependencies for Linux + run: | + sudo apt-get update + sudo apt-get install libsdl2-2.0-0 + shell: bash + if: startsWith(matrix.os, 'ubuntu') && matrix.toolkit == 'wx' + - name: Cache EDM packages + uses: actions/cache@v2 + with: + path: ~/.cache + key: ${{ runner.os }}-${{ matrix.toolkit }}-${{ hashFiles('etstool.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 install -y wheel click coverage + - name: Install test environment + run: edm run -- python etstool.py install --toolkit=${{ matrix.toolkit }} --source + - name: Flake8 + run: edm run -- python etstool.py flake8 + if: startsWith(matrix.os, 'ubuntu') + - name: Run tests + uses: GabrielBB/xvfb-action@v1 + with: + run: edm run -- python etstool.py test --toolkit=${{ matrix.toolkit }} diff --git a/.github/workflows/test-with-edm.yml b/.github/workflows/test-with-edm.yml new file mode 100644 index 000000000..35e696ade --- /dev/null +++ b/.github/workflows/test-with-edm.yml @@ -0,0 +1,69 @@ +# This workflow targets stable released dependencies from EDM. +# Note that some packages may not actually be installed from EDM but from +# PyPI, see etstool.py implementations. + +name: Test with EDM + +on: pull_request + +env: + INSTALL_EDM_VERSION: 3.2.3 + +jobs: + + # Test against EDM packages + test-with-edm: + strategy: + matrix: + os: [ubuntu-latest, macos-latest, windows-latest] + toolkit: ['wx', 'pyqt5', 'pyside2'] + runs-on: ${{ matrix.os }} + env: + # Set root directory, mainly for Windows, so that the EDM Python + # environment lives in the same drive as the cloned source. Otherwise + # 'pip install' raises an error while trying to compute + # relative path between the site-packages and the source directory. + EDM_ROOT_DIRECTORY: ${{ github.workspace }}/.edm + steps: + - uses: actions/checkout@v2 + - name: Install Qt dependencies for Linux + run: | + sudo apt-get update + sudo apt-get install qt5-default + sudo apt-get install libxkbcommon-x11-0 + sudo apt-get install libxcb-icccm4 + sudo apt-get install libxcb-image0 + sudo apt-get install libxcb-keysyms1 + sudo apt-get install libxcb-randr0 + sudo apt-get install libxcb-render-util0 + sudo apt-get install libxcb-xinerama0 + sudo apt-get install pulseaudio + sudo apt-get install libpulse-mainloop-glib0 + shell: bash + if: startsWith(matrix.os, 'ubuntu') && matrix.toolkit != 'wx' + - name: Install Wx dependencies for Linux + run: | + sudo apt-get update + sudo apt-get install libsdl2-2.0-0 + shell: bash + if: startsWith(matrix.os, 'ubuntu') && matrix.toolkit == 'wx' + - name: Cache EDM packages + uses: actions/cache@v2 + with: + path: ~/.cache + key: ${{ runner.os }}-${{ matrix.toolkit }}-${{ hashFiles('etstool.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 install -y wheel click coverage + - name: Install test environment + run: edm run -- python etstool.py install --toolkit=${{ matrix.toolkit }} + - name: Flake8 + run: edm run -- python etstool.py flake8 + if: startsWith(matrix.os, 'ubuntu') + - name: Run tests + uses: GabrielBB/xvfb-action@v1 + with: + run: edm run -- python etstool.py test --toolkit=${{ matrix.toolkit }} From 8989ba9e755ae923f27585d8f40f6445bdf352f3 Mon Sep 17 00:00:00 2001 From: Aaron Ayres Date: Mon, 14 Jun 2021 14:56:57 -0500 Subject: [PATCH 2/3] remove flake8 from cron job --- .github/workflows/ets-from-source.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/workflows/ets-from-source.yml b/.github/workflows/ets-from-source.yml index 1a9a09cfa..86e504687 100644 --- a/.github/workflows/ets-from-source.yml +++ b/.github/workflows/ets-from-source.yml @@ -58,9 +58,6 @@ jobs: run: edm install -y wheel click coverage - name: Install test environment run: edm run -- python etstool.py install --toolkit=${{ matrix.toolkit }} --source - - name: Flake8 - run: edm run -- python etstool.py flake8 - if: startsWith(matrix.os, 'ubuntu') - name: Run tests uses: GabrielBB/xvfb-action@v1 with: From a1aaf509533d531fd65292db64d2a415a7b67cbf Mon Sep 17 00:00:00 2001 From: Aaron Ayres Date: Mon, 14 Jun 2021 14:58:03 -0500 Subject: [PATCH 3/3] dont flake8 at all, codebase isn't clean and we dont have command in etstool --- .github/workflows/test-with-edm.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/workflows/test-with-edm.yml b/.github/workflows/test-with-edm.yml index 35e696ade..3a6295b4b 100644 --- a/.github/workflows/test-with-edm.yml +++ b/.github/workflows/test-with-edm.yml @@ -60,9 +60,6 @@ jobs: run: edm install -y wheel click coverage - name: Install test environment run: edm run -- python etstool.py install --toolkit=${{ matrix.toolkit }} - - name: Flake8 - run: edm run -- python etstool.py flake8 - if: startsWith(matrix.os, 'ubuntu') - name: Run tests uses: GabrielBB/xvfb-action@v1 with: