-
Notifications
You must be signed in to change notification settings - Fork 3
212 lines (199 loc) · 6.64 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
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
name: Rust
on:
push:
branches:
- '*'
- '!gh-pages'
pull_request:
# rust 1.68
env:
CARGO_REGISTRIES_CRATES_IO_PROTOCOL: sparse
jobs:
build:
if: false
runs-on: windows-latest
env:
RUST_BACKTRACE: 1
MINGW_URL: https://ci-mirrors.rust-lang.org/rustc
MIRIFLAGS: -Zmiri-disable-isolation
strategy:
matrix:
target: [x86_64-pc-windows-msvc, i686-pc-windows-msvc, x86_64-pc-windows-gnu, i686-pc-windows-gnu]
include:
- target: x86_64-pc-windows-gnu
archive: x86_64-6.3.0-release-posix-seh-rt_v5-rev2.7z
mingw_dir: mingw64
- target: i686-pc-windows-gnu
archive: i686-6.3.0-release-posix-dwarf-rt_v5-rev2.7z
mingw_dir: mingw32
steps:
- uses: actions/checkout@v4
- run: |
rustup toolchain install --no-self-update stable-${{ matrix.target }}
rustup default stable-${{ matrix.target }}
- name: Check out MinGW toolchain
run: |
set -x
curl -sSf -O "${MINGW_URL}/${{ matrix.archive }}"
7z x -y "${{ matrix.archive }}" -o/c/mingw
rm "${{ matrix.archive }}"
echo "C:\mingw\${{ matrix.mingw_dir }}\bin" >> $GITHUB_PATH
shell: bash
if: matrix.mingw_dir
- run: cargo fetch
- run: cargo build
- run: cargo build --features nightly
- run: cargo build --all-targets
- run: cargo test
- run: cargo test --no-default-features
# NOTE: miri still needs to support more Windows API shims
- if: false
run: |
rustup component add miri
cargo clean
cargo miri setup
cargo miri test
- if: failure()
run: |
Set-PSDebug -Trace 1
Get-ChildItem -Path target\debug\junction-test-*\ | Select-Object FullName, Target
Get-ChildItem -Path target\debug\junction-test-*\junction | Select-Object FullName, Target
shell: powershell
- if: failure()
run: |
dir /aL C:\
dir /aL C:\Users
shell: cmd
msrv:
if: false
runs-on: windows-latest
# needs: [build]
env:
# add_of_mut! requires for soundness
MSRV: 1.56.0
steps:
- uses: actions/checkout@v4
- run: |
rustup toolchain install --no-self-update ${{ env.MSRV }}
rustup default ${{ env.MSRV }}
- run: |
rustup run stable cargo generate-lockfile
rustup run stable cargo fetch
- run: |
cargo build --locked
rustfmt:
if: false
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: cargo fmt -- --check
rustdoc:
runs-on: windows-latest
steps:
- name: Before checking out source and change \n -> \r\n
run: |
git config --global core.autocrlf false
git config --global core.eol lf
- uses: actions/checkout@v4
- run: |
rustup toolchain install --no-self-update nightly
rustup default nightly
- run: cargo doc --all --no-deps # --document-private-items
- run: echo '<meta http-equiv=refresh content=0;url=junction/index.html>' > target/doc/index.html
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: target/doc
retention-days: 1
deploy:
if: github.event_name != 'pull_request' && github.event.ref == 'refs/heads/master'
# Grant GITHUB_TOKEN the permissions required to make a Pages deployment
permissions:
pages: write # to deploy to Pages
id-token: write # to verify the deployment originates from an appropriate source
needs: [rustdoc]
runs-on: ubuntu-latest
steps:
- name: Deploy to GitHub Pages
uses: actions/deploy-pages@v4
clippy:
runs-on: windows-latest
needs: [build]
steps:
- uses: actions/checkout@v4
- run: |
rustup toolchain install --no-self-update nightly -c clippy
rustup default nightly
- run: cargo clippy --all-targets --all-features -- -Dwarnings -A clippy::assertions-on-constants
mirai:
# if: false
runs-on: windows-latest
env:
MSRV: nightly-2023-09-10
steps:
- uses: actions/checkout@v4
with:
path: junction
- uses: actions/checkout@v4
with:
repository: facebookexperimental/MIRAI
path: mirai
- name: rustup
run: |
rustup toolchain install ${{ env.MSRV }} -c rustc-dev
rustup default ${{ env.MSRV }}
- name: setup
working-directory: mirai
shell: bash
run: |
cargo fetch
cargo install --locked --path ./checker
- name: mirai check
working-directory: junction
run: |
cargo mirai --all-targets # for crate compilation
# Use static analyzer Rudra <https://github.com/sslab-gatech/Rudra>.
# FIXME: Disable for now since it's very costly to run.
rudra:
if: false
runs-on: ubuntu-latest
env:
MSRV: nightly-2021-08-20
WIN_TARGET: x86_64-pc-windows-gnu
steps:
- uses: actions/checkout@v4
with:
path: junction
- uses: actions/checkout@v4
with:
repository: sslab-gatech/Rudra
path: Rudra
- name: setup
shell: bash
run: |
# Toolchain setup
rustup toolchain install --no-self-update ${{ env.MSRV }} -c rustc-dev -c miri
rustup default ${{ env.MSRV }}
rustup target add ${{ env.WIN_TARGET }}
# Environment variable setup, put these in your `.bashrc`
export RUDRA_RUST_CHANNEL=${{ env.MSRV }}
export RUDRA_RUNNER_HOME="$HOME/rudra-home"
./setup_rudra_runner_home.py ${RUDRA_RUNNER_HOME}
RUDRA_LIB=$HOME/.rustup/toolchains/${RUDRA_RUST_CHANNEL}-x86_64-unknown-linux-gnu/lib
export RUSTFLAGS="-L ${RUDRA_LIB}"
export LD_LIBRARY_PATH="${LD_LIBRARY_PATH}:${RUDRA_LIB}"
echo "RUDRA_RUNNER_HOME=${RUDRA_RUNNER_HOME}" >> $GITHUB_ENV
echo "RUDRA_RUST_CHANNEL=${RUDRA_RUST_CHANNEL}" >> $GITHUB_ENV
echo "RUSTFLAGS=${RUSTFLAGS}" >> $GITHUB_ENV
echo "LD_LIBRARY_PATH=${LD_LIBRARY_PATH}" >> $GITHUB_ENV
working-directory: Rudra
- name: run
run: |
./install-release.sh
shell: bash
working-directory: Rudra
- run: |
# for single file testing (you need to set library include path, or use `cargo run` instead)
# rudra --crate-type lib tests/unsafe_destructor/normal1.rs
cargo rudra --target ${{ env.WIN_TARGET }} --all-targets # for crate compilation
working-directory: junction