diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml new file mode 100644 index 0000000000..5607ce9c12 --- /dev/null +++ b/.github/workflows/tests.yaml @@ -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 }}