-
-
Notifications
You must be signed in to change notification settings - Fork 2
137 lines (118 loc) · 4.2 KB
/
build_and_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
name: Build and Test with Coverage
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
schedule: # Build every day at 5PM UTC
- cron: '0 17 * * *'
env:
CARGO_TERM_COLOR: always
CARGO_INCREMENTAL: 0
jobs:
test-book-build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: install graphviz
run: sudo apt-get update && sudo apt-get -y install graphviz
- name: install mdbook
run: curl -sSL https://github.com/rust-lang/mdBook/releases/download/v0.4.27/mdbook-v0.4.27-x86_64-unknown-linux-gnu.tar.gz | tar -xz --directory=$HOME/.cargo/bin
- name: install link checker
run: |
curl -sSL https://github.com/Michael-F-Bryan/mdbook-linkcheck/releases/download/v0.7.7/mdbook-linkcheck.x86_64-unknown-linux-gnu.zip > mdbook-linkcheck.zip
mkdir -p $HOME/.cargo/bin
unzip mdbook-linkcheck.zip -d $HOME/.cargo/bin
chmod +x $HOME/.cargo/bin/mdbook-linkcheck
echo "PATH=$HOME/.cargo/bin:$PATH" >> "$GITHUB_ENV"
- name: make book
run: make book
clippy:
runs-on: ubuntu-latest
steps:
- name: Install latest nightly
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: nightly
override: true
components: clippy
- name: Checkout
uses: actions/checkout@v3
- name: run clippy
uses: actions-rs/cargo@v1
with:
command: clippy
args: --tests --no-deps --all-features --all-targets -- --warn clippy::pedantic -D warnings
build-and-test:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ macos-14, ubuntu-latest ]
rust: [ nightly ]
steps:
- name: Checkout
uses: actions/checkout@v3
- name: SetupEnv
run: |
echo "PATH=$GITHUB_WORKSPACE/target/debug:$PATH" >> "$GITHUB_ENV"
echo "CARGO_REGISTRIES_CRATES_IO_PROTOCOL=sparse" >> "$GITHUB_ENV"
- name: Install latest nightly
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: nightly
override: true
target: wasm32-unknown-unknown
- name: InstallLinuxDependencies
if: runner.os == 'Linux'
run: |
sudo apt-get update && sudo apt-get -y install libzmq3-dev binaryen lcov
wget https://github.com/WebAssembly/binaryen/releases/download/version_116/binaryen-version_116-x86_64-linux.tar.gz
tar -xvzf binaryen-version_116-x86_64-linux.tar.gz
sudo cp binaryen-version_116/bin/* /bin/
rm -rf binaryen-version_116
rm binaryen-version_116-x86_64-linux.tar.gz
which wasm-opt
wasm-opt --version
- name: InstallMacDependencies
if: runner.os == 'macOS'
run: brew install zmq binaryen lcov
- name: InstallWasmTools
uses: actions-rs/cargo@v1
with:
command: install
args: wasm-gc wasm-snip
- name: ConfigureCoverage
run: |
cargo install grcov
rustup component add llvm-tools-preview
echo RUSTFLAGS="-C instrument-coverage" >> "$GITHUB_ENV"
echo LLVM_PROFILE_FILE="flow-%p-%m.profraw" >> "$GITHUB_ENV"
- name: build
uses: actions-rs/cargo@v1
with:
command: build
- name: compile flowstdlib to WASM
run: target/debug/flowc -d -g -O flowstdlib
- name: compile flowrcli
run: target/debug/flowc flowr/src/bin/flowrcli
- name: compile flowrgui
run: target/debug/flowc flowr/src/bin/flowrgui
- name: test
uses: actions-rs/cargo@v1
with:
command: test
args: --features "online_tests"
- name: test-examples
uses: actions-rs/cargo@v1
with:
command: test
args: --examples
- name: UploadCoverage
run: |
grcov . --binary-path target/debug/ -s . -t lcov --branch --ignore-not-existing --ignore "/*" -o lcov.info
lcov --remove lcov.info 'target/debug/build/**' '**/errors.rs' '*tests/*' -o lcov.info
bash <(curl -s https://codecov.io/bash) -f lcov.info
rm -f lcov.info