-
Notifications
You must be signed in to change notification settings - Fork 24
136 lines (130 loc) · 3.61 KB
/
ci.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
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
134
135
136
name: CI
on:
push:
branches:
- main
- release/*
pull_request:
branches:
- main
- release/*
- feature/*
env:
CARGO_TERM_COLOR: always
QIRLIB_DOWNLOAD_LLVM: false
jobs:
build:
runs-on: ${{ matrix.config.os }}
env: ${{ matrix.config.env }}
strategy:
fail-fast: false
matrix:
config:
- {
os: "ubuntu-20.04",
arch: "amd64",
target: "checks",
env: {},
}
- {
os: "ubuntu-20.04",
arch: "amd64",
target: "default",
env: {},
}
- {
os: "windows-2019",
arch: "amd64",
target: "default",
env: {},
}
- {
os: "macos-12",
arch: "amd64",
target: "default",
env: {
MACOSX_DEPLOYMENT_TARGET: 10.9
},
}
- {
os: "macos-14",
arch: "aarch64",
target: "default",
env: { },
}
- {
os: "macos-14",
arch: "universal",
target: "default",
env: {
ARCHFLAGS: "-arch arm64 -arch x86_64"
},
}
steps:
- uses: actions/checkout@v4
- name: Setup rust toolchain
uses: ./.github/actions/rust-toolchain
with:
toolchain: 1.80
components: rustfmt clippy
- shell: pwsh
run: |
rustup target add x86_64-apple-darwin
if: ${{ (matrix.config.os == 'macos-14') && (matrix.config.arch == 'universal') }}
- uses: actions/checkout@v4
- name: Set up Python 3.8
uses: actions/setup-python@v5
with:
python-version: 3.8
if: ${{ matrix.config.os != 'macos-14' }}
- name: Install LLVM
uses: ./.github/actions/install-llvm
with:
version: "14"
os: ${{ matrix.config.os }}
arch: ${{ matrix.config.arch }}
directory: ${{ github.workspace }}/target/llvm
target: ${{ matrix.config.target }}
- name: "Build ${{ matrix.config.target }}"
run: ./build.ps1 -t ${{ matrix.config.target }}
shell: pwsh
- name: Artifacts - manylinux
uses: actions/upload-artifact@v4
with:
name: manylinux-artifacts
path: target/wheels/*manylinux_2_*.whl
if: ${{ matrix.config.os == 'ubuntu-20.04' }}
- name: Artifacts
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.config.os }}-${{ matrix.config.arch }}-artifacts
path: target/wheels/*
if: ${{ matrix.config.os != 'ubuntu-20.04' }}
docs:
runs-on: "ubuntu-20.04"
needs: build
steps:
- uses: actions/checkout@v4
with:
submodules: false
- name: Download Build Artifacts
uses: actions/download-artifact@v4
with:
name: manylinux-artifacts
path: target/wheels
- name: Build Docs
run: ./build.ps1 -t docs
shell: pwsh
# Always publish docs as an artifact, but only publish docs to GitHub Pages
# when pushing to main.
- name: Publish Docs as Artifacts
uses: actions/upload-artifact@v4
with:
name: docs
path: docs/_build
- name: Publish Docs to GitHub Pages
uses: JamesIves/github-pages-deploy-action@v4
with:
branch: gh-pages
folder: docs/_build/html
if: ${{ github.event_name == 'push' }}