-
Notifications
You must be signed in to change notification settings - Fork 10
99 lines (87 loc) · 2.52 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
name: CI
on:
push:
branches:
- main
pull_request:
env:
# The NAME makes it easier to copy/paste snippets from other CI configs
NAME: tree-crasher
jobs:
doc:
runs-on: ubuntu-latest
steps:
- name: Cancel previous run
uses: styfle/[email protected]
with:
access_token: ${{ github.token }}
- uses: actions/checkout@v4
- name: Setup mdBook
uses: peaceiris/actions-mdbook@v2
with:
mdbook-version: '0.4.10'
- name: Build docs
run: |
cd doc
mdbook build
- name: Push docs
uses: peaceiris/actions-gh-pages@v4
if: ${{ github.ref == 'refs/heads/main' }}
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: doc/book
- name: Package docs
shell: bash
run: |
tar -cvf doc.tar.gz doc/book/*
- name: Upload docs
uses: actions/upload-artifact@v4
if: github.repository == 'langston-barrett/${{ env.NAME }}'
with:
name: "${{ env.NAME }}-docs"
path: "*.tar.gz"
if-no-files-found: error
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Format
run: cargo fmt && git diff --exit-code
- name: Deps
run: |
rustup update
rustup component add clippy
- uses: Swatinem/rust-cache@23bce251a8cd2ffc3c1075eaa2367cf899916d84
- name: Lint
run: cargo clippy -- --deny warnings
static:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Deps
run: |
sudo apt-get install -y musl-tools
rustup target add x86_64-unknown-linux-musl
- uses: Swatinem/rust-cache@23bce251a8cd2ffc3c1075eaa2367cf899916d84
- run: |
cargo build \
--bin ${NAME}-c \
--bin ${NAME}-css \
--bin ${NAME}-javascript \
--bin ${NAME}-regex \
--bin ${NAME}-rust \
--bin ${NAME}-solidity \
--bin ${NAME}-sql \
--bin ${NAME}-typescript \
--locked \
--release \
--target=x86_64-unknown-linux-musl
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: Swatinem/rust-cache@23bce251a8cd2ffc3c1075eaa2367cf899916d84
- run: env RUSTFLAGS="@$PWD/rustc-flags" cargo test --locked --no-run
- run: env RUSTFLAGS="@$PWD/rustc-flags" cargo test
- run: env RUSTFLAGS="@$PWD/rustc-flags" cargo test --locked --no-run --features=radamsa
- run: env RUSTFLAGS="@$PWD/rustc-flags" cargo test --features=radamsa