forked from fabianschuiki/moore
-
Notifications
You must be signed in to change notification settings - Fork 2
121 lines (103 loc) · 3.44 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
on: [push, pull_request]
name: CI
jobs:
lints:
name: Lints
runs-on: ubuntu-22.04
steps:
- name: Checkout sources
uses: actions/checkout@v2
- name: Install Rust toolchain
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
components: rustfmt, clippy
- name: Run rustfmt
uses: actions-rs/cargo@v1
with:
command: fmt
args: --all -- --check
- name: Run clippy
uses: actions-rs/cargo@v1
continue-on-error: true # TODO: Remove once we have fixed them all
with:
command: clippy
check:
name: Checks
runs-on: ubuntu-22.04
steps:
- name: Checkout sources
uses: actions/checkout@v2
with:
submodules: recursive
- name: Install Rust toolchain
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
components: rustfmt, clippy
- name: Configure Environment
id: env
run: |
echo "CIRCT_SYS_CIRCT_DIR=$GITHUB_WORKSPACE/circt" >> $GITHUB_ENV
echo "::set-output name=circt-hash::$(git rev-parse @:./circt)"
echo "::set-output name=llvm-hash::$(cd circt && git rev-parse @:./llvm)"
# Fetch LLVM from the cache if possible, otherwise rebuild it.
- name: Fetch LLVM from cache
id: cache-llvm
uses: martijnhols/actions-cache/restore@v3
with:
path: circt/llvm/build
key: ${{ runner.os }}-llvm-${{ hashFiles('.github/build-llvm.sh') }}-${{ steps.env.outputs.llvm-hash }}
- name: Rebuild LLVM
if: steps.cache-llvm.outputs.cache-hit != 'true'
run: .github/build-llvm.sh
- name: Upload LLVM to cache
if: steps.cache-llvm.outputs.cache-hit != 'true'
uses: martijnhols/actions-cache/save@v3
with:
path: circt/llvm/build
key: ${{ steps.cache-llvm.outputs.primary-key }}
# Fetch CIRCT from the cache if possible, otherwise rebuild it.
- name: Fetch CIRCT from cache
id: cache-circt
uses: martijnhols/actions-cache/restore@v3
with:
path: circt/build
key: ${{ runner.os }}-circt-${{ hashFiles('.github/build-circt.sh') }}-${{ steps.env.outputs.circt-hash }}
- name: Rebuild CIRCT
if: steps.cache-circt.outputs.cache-hit != 'true'
run: .github/build-circt.sh
- name: Upload CIRCT to cache
if: steps.cache-circt.outputs.cache-hit != 'true'
uses: martijnhols/actions-cache/save@v3
with:
path: circt/build
key: ${{ steps.cache-circt.outputs.primary-key }}
# Run the quick check build.
- name: Run "cargo check"
uses: actions-rs/cargo@v1
with:
command: check
args: --all
# Run the regular build.
- name: Run "cargo build"
uses: actions-rs/cargo@v1
with:
command: build
# Run the unit tests.
- name: Run "cargo test"
uses: actions-rs/cargo@v1
with:
command: test
args: --all
# Run the tests.
- name: Run lit tests
run: circt/llvm/build/bin/llvm-lit test -v
- name: Run regression tests (old)
run: env TERM=xterm-color test/run.sh
- name: Run regression tests (new)
run: python3 scripts/test.py --debug --verbose