-
Notifications
You must be signed in to change notification settings - Fork 9
162 lines (145 loc) · 5.71 KB
/
test.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: Test
on:
push:
schedule:
# trigger weekly at 12am
# this build should run with caches disabled
- cron: "0 0 * * 0"
workflow_dispatch:
env:
CARGO_TERM_COLOR: always
RUST_BACKTRACE: 1
jobs:
security_scan:
name: Security Scan of Dependencies
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
- name: Check Github Permissions
id: check-permissions
uses: scherermichael-oss/action-has-permission@master
with:
required-permission: write
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# this action needs write permnissions for the given Github token
- uses: actions-rs/audit-check@v1
if: ${{ steps.check-permissions.outputs.has-permission }}
with:
token: ${{ secrets.GITHUB_TOKEN }}
build-and-test:
name: Build and Test on ${{ matrix.platform }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
toolchain: [1.72.0]
os: [ubuntu-20.04, macos-11, windows-2019]
experimental: [false]
include:
- platform: Linux
os: ubuntu-20.04
features: z3,boolector,kissat,varisat
- platform: MacOs
os: macos-11
features: z3,boolector,kissat,varisat
- platform: Windows
os: windows-2019
features: z3,varisat
- platform: latest Rust
toolchain: stable
os: ubuntu-latest
# linter and format checkers are not executed for experimental platform
experimental: true
features: z3,boolector,kissat,varisat
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Install Rust ${{ matrix.toolchain }}
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: ${{ matrix.toolchain }}
components: rustfmt, clippy
override: true
- name: Setup Windows Environment
if: ${{ contains(matrix.os, 'windows') }}
# MinGw64 and Git is already installed
# https://github.com/actions/virtual-environments/blob/main/images/win/Windows2019-Readme.md
# Use gcc from cygwin for LP64 data model (not LLP64 with mingw)
run: |
echo "LIBCLANG_PATH=C:\Program Files\LLVM\bin" >> $env:GITHUB_ENV
echo "TEMP=$env:USERPROFILE\AppData\Local\Temp" >> $env:GITHUB_ENV
echo "TMP=$env:USERPROFILE\AppData\Local\Temp" >> $env:GITHUB_ENV
choco upgrade cygwin -y --no-progress
# Workaround for Chocolatey 1.2.0, what we really want is:
# choco install gcc-core make -y --no-progress --source=cygwin
C:\tools\cygwin\cygwinsetup.exe -q -d -N -R C:\tools\cygwin -l C:\tools\cygwin\packages -P gcc-core,make | Out-Default
echo 'C:\tools\cygwin\bin' >> $env:GITHUB_PATH
- name: Check Github Permissions
id: check-permissions
uses: scherermichael-oss/action-has-permission@master
with:
required-permission: write
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Cache Cargo Dependencies
uses: actions/cache@v3
env:
cache-name: cache-cargo-dependencies
# disable cache for scheduled builds
# Unfortunately MacOs in combination with the Github Cache action has a bug:
# https://github.com/actions/virtual-environments/issues/2619
# This is a workaround to fix curroption of cached cargo dependencies
if: ${{ github.event_name != 'schedule' && !contains(matrix.os, 'macos') }}
with:
# cargo cache files are stored in `~/.cargo` on Linux/macOS
# source for paths: https://doc.rust-lang.org/cargo/guide/cargo-home.html#caching-the-cargo-home-in-ci
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target
key: ${{ runner.os }}-${{ github.job }}-${{ matrix.toolchain }}-${{ hashFiles('**/Cargo.lock') }}
- name: Check Format
uses: actions-rs/cargo@v1
if: ${{ !matrix.experimental }}
with:
command: fmt
args: -- --check
- name: Clippy
uses: actions-rs/clippy-check@v1
# execute Clippy with Github integration for the target platform (Linux with fixed toolchain version)
# this action needs write permnissions for the given Github token
if: ${{ !matrix.experimental && contains(matrix.os, 'ubuntu') && steps.check-permissions.outputs.has-permission }}
with:
token: ${{ secrets.GITHUB_TOKEN }}
args: --all-targets --features ${{ matrix.features }} -- -D warnings
name: Clippy
- name: Clippy CLI
uses: actions-rs/cargo@v1
# execute CLI-only version of Clippy for all platforms besides the target and the experimental platform
if: ${{ !matrix.experimental && (!contains(matrix.os, 'ubuntu') || !steps.check-permissions.outputs.has-permission) }}
with:
command: clippy
args: --all-targets --features ${{ matrix.features }} -- -D warnings
- name: Build
uses: actions-rs/cargo@v1
with:
command: build
args: --features ${{ matrix.features }} --locked
- name: Build Benchmarks
uses: actions-rs/cargo@v1
with:
command: bench
args: --benches --no-run --features ${{ matrix.features }} --locked
- name: Doc
uses: actions-rs/cargo@v1
with:
command: doc
args: --features ${{ matrix.features }} --locked
- name: Test
uses: actions-rs/cargo@v1
with:
command: test
args: --features ${{ matrix.features }} --locked