-
Notifications
You must be signed in to change notification settings - Fork 1
38 lines (34 loc) · 1.05 KB
/
rules.yml
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
# A single CI script with github workflow
name: Tests
env:
CUDA_PATH:
on:
workflow_dispatch:
push:
pull_request:
types: [labeled]
jobs:
check:
# job to check cuda availability for local gpu host runners
runs-on: ubuntu-latest
steps:
- id: step1
run: echo "test=${{ env.CUDA_PATH != ''}}" >> "$GITHUB_OUTPUT"
- id: step2
run: echo "test=${{ contains(github.event.pull_request.labels.*.name, 'run-workflow') || github.event_name == 'push' }}" >> "$GITHUB_OUTPUT"
outputs:
cuda_avail: ${{ fromJSON(steps.step1.outputs.test) && fromJSON(steps.step2.outputs.test) }}
build:
# job to build
needs: check
if: ${{fromJSON(needs.check.outputs.cuda_avail)}}
strategy:
matrix:
os: [ubuntu-latest]
python-version: [3.9, "3.10", "3.11", "3.12"]
uses: qiboteam/workflows/.github/workflows/rules-poetry.yml@main
with:
os: ${{ matrix.os }}
python-version: ${{ matrix.python-version }}
poetry-extras: "--with analysis,tests"
secrets: inherit