-
-
Notifications
You must be signed in to change notification settings - Fork 41
133 lines (127 loc) · 4.88 KB
/
Copy pathtests.yml
File metadata and controls
133 lines (127 loc) · 4.88 KB
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
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
name: Tests
on: [ push, pull_request ]
permissions:
contents: read # to fetch code (actions/checkout)
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
jobs:
coverage:
name: Release + Coverage ${{ matrix.runs-on }}
runs-on: ${{ matrix.runs-on }}
strategy:
fail-fast: false
matrix:
runs-on: [ubuntu-latest, ubuntu-24.04-arm, macos-latest]
environment: [coverage]
env:
CCACHE_DIR: ${{ github.workspace }}/packages/coverage/.ccache
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- uses: ./.github/ccache
with:
key_segment: ${{ github.workflow }}-${{ matrix.environment }}-${{ matrix.runs-on }}
- name: Setup ${{ matrix.environment }} environment
uses: prefix-dev/setup-pixi@a09b6247153796b190642a2b53fac4241043cf6f # v0.10.0
with:
pixi-version: v0.77.0
cache: true
cache-key: pixi-v0-${{ github.job }}
environments: ${{ matrix.environment }}
- name: Ccache performance
shell: bash
run: pixi exec ccache -s
- name: Determine number of workers
run: |
if [[ "$RUNNER_OS" == "Linux" ]]; then
echo "NUM_WORKERS=$(nproc)" >> $GITHUB_ENV
elif [[ "$RUNNER_OS" == "macOS" ]]; then
echo "NUM_WORKERS=$(sysctl -n hw.ncpu)" >> $GITHUB_ENV
elif [[ "$RUNNER_OS" == "Windows" ]]; then
echo "NUM_WORKERS=$NUMBER_OF_PROCESSORS" >> "$GITHUB_ENV"
fi
shell: bash
- name: Run tests
run: pixi run --environment=coverage tests $NUM_WORKERS
- name: Generate coverage report
run: pixi run --skip-deps coverage
- name: Upload HTML coverage report
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: cov-html-${{ matrix.runs-on }}
path: .pixi/envs/coverage/share/xsf/cov/coverage_report/**
tests-release:
# for platforms without coverage support
name: Release
runs-on: ${{ matrix.runs-on }}
strategy:
fail-fast: false
matrix:
runs-on: [windows-latest]
environment: [tests-release]
env:
CCACHE_DIR: ${{ github.workspace }}/packages/tests-release/.ccache
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- uses: ./.github/ccache
with:
key_segment: ${{ github.workflow }}-${{ matrix.environment }}-${{ matrix.runs-on }}
- name: Setup ${{ matrix.environment }} environment
uses: prefix-dev/setup-pixi@a09b6247153796b190642a2b53fac4241043cf6f # v0.10.0
with:
pixi-version: v0.77.0
cache: true
cache-key: pixi-v0-${{ github.job }}
environments: ${{ matrix.environment }}
- name: Ccache performance
shell: bash
run: pixi exec ccache -s
- name: Determine number of workers
run: |
if [[ "$RUNNER_OS" == "Linux" ]]; then
echo "NUM_WORKERS=$(nproc)" >> $GITHUB_ENV
elif [[ "$RUNNER_OS" == "macOS" ]]; then
echo "NUM_WORKERS=$(sysctl -n hw.ncpu)" >> $GITHUB_ENV
elif [[ "$RUNNER_OS" == "Windows" ]]; then
echo "NUM_WORKERS=$NUMBER_OF_PROCESSORS" >> "$GITHUB_ENV"
fi
shell: bash
- name: Run tests
run: pixi run --environment=${{ matrix.environment }} tests $NUM_WORKERS
tests-debug:
name: Debug ${{ matrix.runs-on }}
runs-on: ${{ matrix.runs-on }}
strategy:
fail-fast: false
matrix:
runs-on: [ubuntu-latest, ubuntu-24.04-arm]
environment: [tests-debug]
env:
CCACHE_DIR: ${{ github.workspace }}/packages/tests-debug/.ccache
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- uses: ./.github/ccache
with:
key_segment: ${{ github.workflow }}-${{ matrix.environment }}-${{ matrix.runs-on }}
- name: Setup ${{ matrix.environment }} environment
uses: prefix-dev/setup-pixi@a09b6247153796b190642a2b53fac4241043cf6f # v0.10.0
with:
pixi-version: v0.77.0
cache: true
cache-key: pixi-v0-${{ github.job }}
environments: ${{ matrix.environment }}
- name: Ccache performance
shell: bash
run: pixi exec ccache -s
- name: Determine number of workers
run: |
if [[ "$RUNNER_OS" == "Linux" ]]; then
echo "NUM_WORKERS=$(nproc)" >> $GITHUB_ENV
elif [[ "$RUNNER_OS" == "macOS" ]]; then
echo "NUM_WORKERS=$(sysctl -n hw.ncpu)" >> $GITHUB_ENV
elif [[ "$RUNNER_OS" == "Windows" ]]; then
echo "NUM_WORKERS=$NUMBER_OF_PROCESSORS" >> "$GITHUB_ENV"
fi
shell: bash
- name: Run tests
run: pixi run --environment=${{ matrix.environment }} tests $NUM_WORKERS