-
Notifications
You must be signed in to change notification settings - Fork 7
162 lines (160 loc) · 5.01 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
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
name: CI
# Run on main, any tag or any pull request
on:
pull_request:
branches:
- main
push:
branches:
- main
tags: '*'
concurrency:
# cancel in progress builds for pull requests
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ startswith(github.ref, 'refs/pull/') }}
jobs:
os-test:
runs-on: ${{ matrix.os }}
# don't run on draft PRs
if: ${{ github.event_name == 'push' || !github.event.pull_request.draft }}
# allow windows to fail
continue-on-error: ${{ matrix.os == 'windows-latest' }}
strategy:
fail-fast: true
max-parallel: 2
matrix:
group:
- Braket-unit
- PyBraket-unit
os: [windows-latest, macOS-latest]
arch: ['x64']
steps:
- uses: actions/checkout@v1
- name: "Set up Julia"
uses: julia-actions/setup-julia@v1
with:
version: 1.9
arch: ${{ matrix.arch }}
- uses: julia-actions/julia-buildpkg@latest
- run: |
git config --global user.name Tester
git config --global user.email [email protected]
- name: "Dev PyBraket package on Windows"
if: ${{ matrix.os == 'windows-latest' }}
run: |
julia --project -e 'using Pkg; Pkg.develop(path=joinpath(pwd(), "PyBraket"))'
# must escape for windows
- name: "Dev PyBraket package on OSX"
if: ${{ matrix.os == 'macOS-latest' }}
run: |
julia --project -e 'using Pkg; Pkg.develop(path=joinpath(pwd(), "PyBraket"))'
- name: "Run tests"
uses: julia-actions/julia-runtest@v1
env:
GROUP: ${{ matrix.group }}
BRAKET_CI: true
JULIA_CONDAPKG_VERBOSITY: 2
version-test:
runs-on: ubuntu-latest
# don't run on draft PRs
if: ${{ github.event_name == 'push' || !github.event.pull_request.draft }}
# allow failures on nightly or beta Julia
continue-on-error: ${{ matrix.version == 'nightly'}}
strategy:
fail-fast: true
max-parallel: 2
matrix:
group:
- Braket-unit
- PyBraket-unit
version: ['1.6', '1.7', '1.8', '1.9', '1.10', 'nightly']
arch: ['x64']
steps:
- uses: actions/checkout@v1
- name: "Set up Julia"
uses: julia-actions/setup-julia@v1
with:
version: ${{ matrix.version }}
arch: ${{ matrix.arch }}
- uses: julia-actions/julia-buildpkg@latest
- run: |
git config --global user.name Tester
git config --global user.email [email protected]
- name: "Dev PyBraket package"
run: |
julia --project -e 'using Pkg; Pkg.develop(path=joinpath(pwd(), "PyBraket"))'
- name: "Run tests"
uses: julia-actions/julia-runtest@v1
env:
JULIA_CONDAPKG_VERBOSITY: 2
BRAKET_CI: true
GROUP: ${{ matrix.group }}
- name: "Process coverage"
uses: julia-actions/julia-processcoverage@v1
with:
directories: src,PyBraket/src
- name: "Upload coverage"
uses: codecov/codecov-action@v2
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: lcov.info
examples:
name: Example notebooks
runs-on: ubuntu-latest
if: ${{ github.event_name == 'push' || !github.event.pull_request.draft }}
needs: [os-test, version-test]
strategy:
fail-fast: true
matrix:
group:
- Examples-unit
version: ['1.9']
arch: ['x64']
steps:
- uses: actions/checkout@v1
- name: "Set up Julia"
uses: julia-actions/setup-julia@v1
with:
version: ${{ matrix.version }}
arch: ${{ matrix.arch }}
- uses: julia-actions/julia-buildpkg@latest
- run: |
git config --global user.name Tester
git config --global user.email [email protected]
- name: "Dev PyBraket package"
run: |
julia --project -e 'using Pkg; Pkg.develop(path=joinpath(pwd(), "PyBraket"))'
- name: "Run tests"
uses: julia-actions/julia-runtest@v1
env:
JULIA_CONDAPKG_VERBOSITY: 2
BRAKET_CI: true
GROUP: ${{ matrix.group }}
- name: "Process coverage"
uses: julia-actions/julia-processcoverage@v1
with:
directories: src,PyBraket/src
- name: "Upload coverage"
uses: codecov/codecov-action@v2
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: lcov.info
docs:
name: Documentation
runs-on: ubuntu-latest
if: ${{ github.event_name == 'push' || !github.event.pull_request.draft }}
needs: [os-test, version-test]
steps:
- uses: actions/checkout@v2
- uses: julia-actions/setup-julia@v1
with:
version: '1'
- run: |
julia --project=docs -e '
using Pkg
Pkg.develop(PackageSpec(path=pwd()))
Pkg.instantiate()
include("docs/make.jl")'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
DOCUMENTER_KEY: ${{ secrets.DOCUMENTER_KEY }}