-
Notifications
You must be signed in to change notification settings - Fork 1
124 lines (121 loc) · 3.83 KB
/
Copy pathrust_tests.yml
File metadata and controls
124 lines (121 loc) · 3.83 KB
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
name: Rust Tests
env:
SQLX_OFFLINE: true
APP_BASE_URL: https://ci.coreyja.com
on:
push:
branches:
- main
pull_request:
types: [opened, synchronize]
workflow_dispatch:
jobs:
lint:
name: Lint
runs-on: ubuntu-latest
env:
CARGO_INCREMENTAL: 0
steps:
- name: Setup | Checkout
uses: actions/checkout@v2
- uses: awalsh128/cache-apt-pkgs-action@latest
with:
packages: protobuf-compiler libasound2-dev
version: v0
- name: Install rust
uses: actions-rust-lang/setup-rust-toolchain@v1
with:
components: rustfmt, clippy
- uses: Swatinem/rust-cache@v2
- 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 | Format
run: cargo fmt --all -- --check
- name: Build | Lint
run: cargo clippy --locked --all-targets --no-deps -- -Dwarnings
doc:
name: Doc
runs-on: ubuntu-latest
env:
CARGO_INCREMENTAL: 0
steps:
- name: Setup | Checkout
uses: actions/checkout@v2
- uses: awalsh128/cache-apt-pkgs-action@latest
with:
packages: protobuf-compiler libasound2-dev
version: v0
- name: Install rust
uses: actions-rust-lang/setup-rust-toolchain@v1
- uses: Swatinem/rust-cache@v2
- 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 --locked --workspace --no-deps
test:
name: Test
env:
CARGO_INCREMENTAL: 0
DATABASE_URL: postgres://postgres:postgres@localhost:5432/postgres
services:
postgres:
image: postgres
env:
POSTGRES_PASSWORD: postgres
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 5432:5432
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
- name: Install rust
uses: actions-rust-lang/setup-rust-toolchain@v1
with:
toolchain: ${{ matrix.rust }}
- uses: Swatinem/rust-cache@v2
- uses: awalsh128/cache-apt-pkgs-action@latest
with:
packages: protobuf-compiler libasound2-dev
version: v0
- 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 --locked --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