Skip to content

Commit

Permalink
Merge GH Actions workflows that run tests into a single workflow
Browse files Browse the repository at this point in the history
Signed-off-by: Jean-Christophe Morin <[email protected]>
  • Loading branch information
JeanChristopheMorinPerso committed Jan 6, 2024
1 parent 7e8617d commit 3c6cd89
Showing 1 changed file with 83 additions and 0 deletions.
83 changes: 83 additions & 0 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
name: tests
on:
pull_request:
paths:
- 'src/**'
- '.github/workflows/tests.yaml'
- '!src/rez/utils/_version.py'
- '!**.md'
push:
paths:
- 'src/**'
- '.github/workflows/tests.yaml'
- '!src/rez/utils/_version.py'
- '!**.md'
workflow_dispatch:

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
core:
name: Core tests

runs-on: ${{ matrix.os }}

strategy:
matrix:
os: ['macos-11', 'ubuntu-latest', 'windows-2019']
python-version: ['3.7', '3.9', '3.10', '3.11']
include:
- os: macos-11
shells: 'sh,csh,bash,tcsh,zsh,pwsh'
- os: ubuntu-latest
shells: 'sh,csh,bash,tcsh,zsh,pwsh'
- os: windows-2019
shells: 'cmd,pwsh,gitbash'
REZ_SET_PATH_COMMAND: '$env:PATH="$env:PATH;C:\ProgramData\rez\Scripts\rez"'

fail-fast: false

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}

- name: Install test system dependencies (linux)
if: ${{ matrix.os == 'ubuntu-latest' }}
run: |
set -ex
sudo apt-get update
cmake --version
pwsh --version
sudo apt-get install -y csh tcsh zsh
- name: Install rez
run: python ./install.py ./installdir

- name: Install test dependencies
if: ${{ matrix.os != 'windows-2019' }}
run: ./installdir/bin/rez/rez-python -m pip install pytest-cov parameterized

- name: Install test dependencies
if: ${{ matrix.os == 'windows-2019' }}
run: .\installdir\Scripts\rez\rez-python -m pip install pytest-cov parameterized

- name: Run tests
if: ${{ matrix.os != 'windows-2019' }}
run: ./installdir/bin/rez/rez-selftest -v
env:
_REZ_ENSURE_TEST_SHELLS: ${{ matrix.shells }}

- name: Run tests
if: ${{ matrix.os == 'windows-2019' }}
run: .\installdir\Scripts\rez\rez-selftest -v
env:
_REZ_ENSURE_TEST_SHELLS: ${{ matrix.shells }}

0 comments on commit 3c6cd89

Please sign in to comment.