-
Notifications
You must be signed in to change notification settings - Fork 337
108 lines (92 loc) · 2.96 KB
/
tests.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
name: tests
on:
pull_request:
paths:
- 'src/**'
- 'install.py'
- 'setup.py'
- 'MANIFEST.in'
- 'pyproject.toml'
- '.github/workflows/tests.yaml'
- '!src/rez/utils/_version.py'
- '!**.md'
push:
paths:
- 'src/**'
- 'install.py'
- 'setup.py'
- 'MANIFEST.in'
- 'pyproject.toml'
- '.github/workflows/tests.yaml'
- '!src/rez/utils/_version.py'
- '!**.md'
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
permissions:
contents: read
jobs:
core:
name: Tests
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: ['macos-latest', 'ubuntu-latest', 'windows-latest']
python-version: ['3.8', '3.9', '3.10', '3.11']
include:
- os: macos-latest
shells: 'sh,csh,bash,tcsh,zsh,pwsh'
rez-path: /installdir/bin/rez
- os: ubuntu-latest
shells: 'sh,csh,bash,tcsh,zsh,pwsh'
rez-path: /installdir/bin/rez
- os: windows-latest
shells: 'cmd,pwsh,gitbash'
rez-path: \installdir\Scripts\rez
# Python 3.7 is not supported on Apple Silicon.
# macos-13 is the last macos runner image to run on Intel CPUs.
- os: macos-13
shells: 'sh,csh,bash,tcsh,zsh,pwsh'
rez-path: /installdir/bin/rez
python-version: '3.7'
fail-fast: false
steps:
- name: Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Setup python ${{ matrix.python-version }}
uses: actions/setup-python@0b93645e9fea7318ecaed2b359559ac225c90a2b # v5.3.0
with:
python-version: ${{ matrix.python-version }}
- name: Install test system dependencies (linux)
if: ${{ startsWith(matrix.os, 'ubuntu-') }}
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: Setup environment variables
shell: bash
env:
_GH_REZ_INSTALL_PATH: ${{ github.workspace }}${{ matrix.rez-path }}
run: |
echo "$_GH_REZ_INSTALL_PATH" >> $GITHUB_PATH
- name: Install test dependencies
run: rez-python -m pip install pytest-cov parameterized
- name: Run tests
id: tests
run: rez-selftest -v -- --cov=rez --cov-report=xml:coverage.xml
env:
_REZ_ENSURE_TEST_SHELLS: ${{ matrix.shells }}
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@b9fd7d16f6d7d1b5d2bec1a2887e65ceed900238 # v4.6.0
# Run on both success and failure, but only if coverage.xml exists.
if: ${{ hashFiles('coverage.xml') != '' && (steps.tests.outcome == 'success' || steps.tests.outcome == 'failure') }}
with:
slug: AcademySoftwareFoundation/rez
files: 'coverage.xml'
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}