Test with EDM using ETS packages from source #110
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Test with EDM using ETS packages from source | |
on: | |
schedule: | |
- cron: '0 0 * * 5' | |
# Make it possible to manually trigger the workflow | |
workflow_dispatch: | |
env: | |
INSTALL_EDM_VERSION: 3.5.0 | |
QT_MAC_WANTS_LAYER: 1 | |
jobs: | |
# Test against EDM packages | |
test-with-edm: | |
strategy: | |
matrix: | |
os: [ubuntu-latest, macos-latest, windows-latest] | |
toolkit: ['pyside6'] | |
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@v3 | |
- name: Install Qt dependencies | |
uses: ./.github/actions/install-qt-support | |
if: matrix.toolkit != 'wx' | |
- name: Cache EDM packages | |
uses: actions/cache@v3 | |
with: | |
path: ~/.cache | |
key: ${{ runner.os }}-${{ matrix.toolkit }}-${{ hashFiles('etstool.py') }} | |
- name: Setup EDM | |
uses: enthought/setup-edm-action@v2 | |
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: Run tests (Linux) | |
if: matrix.os == 'ubuntu-latest' | |
run: xvfb-run -a edm run -- python etstool.py test --toolkit=${{ matrix.toolkit }} | |
- name: Run tests (not Linux) | |
if: matrix.os != 'ubuntu-latest' | |
run: edm run -- python etstool.py test --toolkit=${{ matrix.toolkit }} | |
notify-on-failure: | |
needs: test-with-edm | |
if: failure() | |
runs-on: ubuntu-latest | |
steps: | |
- name: Notify Slack channel on failure | |
uses: voxmedia/github-action-slack-notify-build@v1 | |
with: | |
channel_id: ${{ secrets.ETS_SLACK_CHANNEL_ID }} | |
status: FAILED | |
color: danger | |
env: | |
SLACK_BOT_TOKEN: ${{ secrets.SLACK_ACTION_SECRET }} | |
notify-on-success: | |
needs: test-with-edm | |
if: success() | |
runs-on: ubuntu-latest | |
steps: | |
- name: Notify Slack channel on success | |
uses: voxmedia/github-action-slack-notify-build@v1 | |
with: | |
channel_id: ${{ secrets.ETS_BOTS_SLACK_CHANNEL_ID }} | |
status: SUCCESS | |
color: good | |
env: | |
SLACK_BOT_TOKEN: ${{ secrets.SLACK_ACTION_SECRET }} |