-
Notifications
You must be signed in to change notification settings - Fork 2
115 lines (112 loc) · 3.66 KB
/
rust_tests.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
name: Rust Tests
env:
DATABASE_URL: "sqlite:/home/runner/work/coreyja.com/coreyja.com/server/db.sqlite3"
SQLX_OFFLINE: true
APP_BASE_URL: https://ci.coreyja.com
on:
push:
branches:
- main
pull_request:
types: [opened, synchronize]
jobs:
lint:
name: Lint
runs-on: ubuntu-latest
env:
CARGO_INCREMENTAL: 0
SCCACHE_GHA_ENABLED: "true"
RUSTC_WRAPPER: "sccache"
steps:
- name: Setup | Checkout
uses: actions/checkout@v2
- uses: awalsh128/cache-apt-pkgs-action@latest
with:
packages: protobuf-compiler libasound2-dev
version: v0
- uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt clippy
- name: Run sccache-cache
uses: mozilla-actions/sccache-action@v0.0.3
- run: |
curl -sLO https://github.com/tailwindlabs/tailwindcss/releases/latest/download/tailwindcss-linux-x64 && \
chmod +x tailwindcss-linux-x64 && \
mv tailwindcss-linux-x64 tailwindcss && \
./tailwindcss -i server/src/styles/tailwind.css -o target/tailwind.css
- name: Build | Lint
run: cargo clippy --all-targets --no-deps -- -Dwarnings
doc:
name: Doc
runs-on: ubuntu-latest
env:
CARGO_INCREMENTAL: 0
SCCACHE_GHA_ENABLED: "true"
RUSTC_WRAPPER: "sccache"
steps:
- name: Setup | Checkout
uses: actions/checkout@v2
- uses: awalsh128/cache-apt-pkgs-action@latest
with:
packages: protobuf-compiler libasound2-dev
version: v0
- uses: dtolnay/rust-toolchain@stable
- name: Run sccache-cache
uses: mozilla-actions/sccache-action@v0.0.3
- run: |
curl -sLO https://github.com/tailwindlabs/tailwindcss/releases/latest/download/tailwindcss-linux-x64 && \
chmod +x tailwindcss-linux-x64 && \
mv tailwindcss-linux-x64 tailwindcss && \
./tailwindcss -i server/src/styles/tailwind.css -o target/tailwind.css
- name: Cargo Doc
run: cargo doc --workspace --no-deps
test:
name: Test
env:
CARGO_INCREMENTAL: 0
SCCACHE_GHA_ENABLED: "true"
RUSTC_WRAPPER: "sccache"
strategy:
fail-fast: false
matrix:
os:
- ubuntu-latest
rust:
- stable
experimental:
- false
include:
- rust: nightly
os: ubuntu-latest
experimental: true
runs-on: ${{ matrix.os }}
continue-on-error: ${{ matrix.experimental }}
steps:
- name: Setup | Checkout
uses: actions/checkout@v2
- uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ matrix.rust }}
- uses: awalsh128/cache-apt-pkgs-action@latest
with:
packages: protobuf-compiler libasound2-dev
version: v0
- name: Run sccache-cache
uses: mozilla-actions/sccache-action@v0.0.3
- run: |
curl -sLO https://github.com/tailwindlabs/tailwindcss/releases/latest/download/tailwindcss-linux-x64 && \
chmod +x tailwindcss-linux-x64 && \
mv tailwindcss-linux-x64 tailwindcss && \
./tailwindcss -i server/src/styles/tailwind.css -o target/tailwind.css
- name: Test
run: cargo test --all-targets
cargo-deny:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- name: Install cargo-binstall
run: curl -L --proto '=https' --tlsv1.2 -sSf https://raw.githubusercontent.com/cargo-bins/cargo-binstall/main/install-from-binstall-release.sh | bash
- name: Install cargo-deny
run: cargo binstall --no-confirm cargo-deny
- name: Cargo Deny
run: cargo-deny check bans