-
Notifications
You must be signed in to change notification settings - Fork 24
124 lines (119 loc) · 3.45 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
name: CI
on:
push:
branches:
- main
- release/*
pull_request:
branches:
- main
- release/*
- feature/*
env:
CARGO_TERM_COLOR: always
QIRLIB_DOWNLOAD_LLVM: false
MACOSX_DEPLOYMENT_TARGET: 10.9
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: "manylinux",
env: {},
}
- {
os: "ubuntu-20.04",
arch: "amd64",
target: "default",
env: {},
}
- {
os: "windows-2019",
arch: "amd64",
target: "default",
env: {},
}
- {
os: "macos-11",
arch: "amd64",
target: "default",
env: {},
}
steps:
- uses: actions/checkout@v3
- name: Setup rust toolchain
uses: ./.github/actions/rust-toolchain
with:
toolchain: 1.64.0
components: rustfmt clippy
- name: Install LLVM
uses: ./.github/actions/install-llvm
with:
version: "14"
os: ${{ matrix.config.os }}
directory: ${{ github.workspace }}/target/llvm
target: ${{ matrix.config.target }}
- name: Linux - Install build dependencies, ccache, ninja
run: sudo apt-get install -y ccache ninja-build
if: ${{ matrix.config.os == 'ubuntu-20.04' }}
- name: Windows - Install build dependencies, sccache, ninja
run: choco install --accept-license -y sccache ninja
if: ${{ matrix.config.os == 'windows-2019' }}
- name: MacOS - Install build dependencies, ccache, ninja
run: brew install ccache ninja
if: ${{ matrix.config.os == 'macos-11' }}
- name: "Build ${{ matrix.config.target }}"
run: ./build.ps1 -t ${{ matrix.config.target }}
shell: pwsh
- name: Artifacts - manylinux
uses: actions/upload-artifact@v2
with:
name: manylinux-artifacts
path: target/wheels/*manylinux_2_17*.whl
if: ${{ matrix.config.os == 'ubuntu-20.04' }}
- name: Artifacts
uses: actions/upload-artifact@v2
with:
name: ${{ matrix.config.os }}-artifacts
path: target/wheels/*
if: ${{ matrix.config.os != 'ubuntu-20.04' }}
docs:
runs-on: "ubuntu-20.04"
needs: build
steps:
- uses: actions/checkout@v2
with:
submodules: false
- name: Download Build Artifacts
uses: actions/download-artifact@v2
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@v2
with:
name: docs
path: docs/_build
- name: Publish Docs to GitHub Pages
uses: JamesIves/[email protected]
with:
branch: gh-pages
folder: docs/_build/html
if: ${{ github.event_name == 'push' }}