-
Notifications
You must be signed in to change notification settings - Fork 53
162 lines (133 loc) · 3.78 KB
/
rust.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: Build
on:
# Triggers the workflow on push or pull request events but only for the master branch
push:
pull_request:
branches: [ master ]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
jobs:
check:
name: Check
runs-on: ubuntu-latest
container: ghcr.io/plc-lang/rust-llvm:latest
steps:
- uses: actions/checkout@v3
- name: Run Check
run: |
./scripts/build.sh --check
test-linux-lit:
name: LIT
runs-on: ubuntu-latest
container: ghcr.io/plc-lang/rust-llvm:latest
steps:
- uses: actions/checkout@v3
- name: Install python3-pip
shell: bash
run: apt install -y python3-pip
- name: Install lit
shell: bash
run: pip install lit
test-linux:
name: Test Linux
runs-on: ubuntu-latest
container: ghcr.io/plc-lang/rust-llvm:latest
steps:
- uses: actions/checkout@v3
- name: Cargo test
shell: bash
run: |
echo "Build command : ./scripts/build.sh --build --test"
./scripts/build.sh --build --test
package-linux:
name: Package Linux
runs-on: ubuntu-latest
container: ghcr.io/plc-lang/rust-llvm:latest
steps:
- uses: actions/checkout@v3
- name: Release Build
shell: bash
run: |
echo "Build command : ./scripts/build.sh --build --release"
./scripts/build.sh --build --release --package \
--target x86_64-unknown-linux-gnu,aarch64-unknown-linux-gnu
- uses: actions/upload-artifact@master
with:
name: plc
path: target/release/plc
- uses: actions/upload-artifact@master
with:
name: schema
path: compiler/plc_project/schema
- uses: actions/upload-artifact@master
with:
name: stdlib
path: output
test-windows:
name: Test Windows
runs-on: windows-2022
env:
toolchain-version: 1.77.0
llvm-version: 14.0.6
steps:
- uses: actions/checkout@v3
- name: Install Rust
uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ env.toolchain-version }}
- name: Install LLVM
uses: ghaith/install-llvm-action@latest
with:
version: ${{ env.llvm-version }}
directory: "./llvm"
- name: Cargo test (Unit)
uses: actions-rs/cargo@v1
with:
command: test
args: --lib -- --nocapture
- name: Cargo test (Correctness)
uses: actions-rs/cargo@v1
with:
command: test
args: correctness -- --nocapture --test-threads=1
- name: Cargo test (Integration)
uses: actions-rs/cargo@v1
with:
command: test
args: integration -- --nocapture --test-threads=1
- name: Release Build
uses: actions-rs/cargo@v1
with:
command: build
args: --release
- uses: actions/upload-artifact@master
with:
name: plc.exe
path: target/release/plc.exe
style:
name: Check Style
runs-on: ubuntu-latest
container: ghcr.io/plc-lang/rust-llvm:latest
steps:
- uses: actions/checkout@v3
- name: Run Checks
run: |
./scripts/build.sh --check-style
coverage:
name: Run Coverage
runs-on: ubuntu-latest
container: ghcr.io/plc-lang/rust-llvm:latest
steps:
- uses: actions/checkout@v3
- name: Run Checks
run: |
./scripts/build.sh --coverage
- name: Upload to codecov.io
uses: codecov/codecov-action@v3
with:
files: lcov.info
- name: Archive code coverage results
uses: actions/upload-artifact@v1
with:
name: code-coverage-report
path: lcov.info