-
Notifications
You must be signed in to change notification settings - Fork 18
106 lines (83 loc) · 3.28 KB
/
continuous-integration.yaml
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
# yaml-language-server: $schema=https://json.schemastore.org/github-workflow
name: continuous-integration
permissions:
contents: read
on:
pull_request:
push:
branches:
- main
workflow_dispatch:
env:
CARGO_INCREMENTAL: 0
CARGO_TERM_COLOR: always
RUST_BACKTRACE: short
jobs:
continuous-integration:
name: Building project and running tests
runs-on: ${{ matrix.runner_os }}
strategy:
matrix:
target:
- x86_64-unknown-linux-musl
include:
- target: x86_64-unknown-linux-musl
runner_os: ubuntu-latest
steps:
- name: Install dependencies for `musl libc` on Linux
if: matrix.target == 'x86_64-unknown-linux-musl'
run: |
sudo apt -y install musl-tools
- name: Check out repository
uses: actions/checkout@v4
- name: Install Rust toolchains for both native target and WASM
uses: dsherret/rust-toolchain-file@v1
- name: Cache Rust toolchain and build artifacts
uses: Swatinem/rust-cache@v2
with:
# Distinguished by the action name to avoid sharing across different actions!
shared-key: "continuous-integration"
- name: Install Trunk for building the webapp
run: |
cargo install --locked trunk
- name: Check ofdb-application crate
run: |
cargo check --locked --all-targets --all-features --manifest-path ofdb-application/Cargo.toml
- name: Check ofdb-entities crate
run: |
cargo check --locked --all-targets --all-features --manifest-path ofdb-entities/Cargo.toml
- name: Check ofdb-core crate
run: |
cargo check --locked --all-targets --all-features --manifest-path ofdb-core/Cargo.toml
- name: Check ofdb-db-sqlite crate
run: |
cargo check --locked --all-targets --all-features --manifest-path ofdb-db-sqlite/Cargo.toml
- name: Check ofdb-db-tantivy crate
run: |
cargo check --locked --all-targets --all-features --manifest-path ofdb-db-tantivy/Cargo.toml
- name: Check ofdb-boundary crate
run: |
cargo check --locked --all-targets --all-features --manifest-path ofdb-boundary/Cargo.toml
- name: Check ofdb-frontend-api crate
run: |
cargo check --locked --all-targets --all-features --manifest-path ofdb-frontend-api/Cargo.toml
- name: Check ofdb-gateways crate
run: |
cargo check --locked --all-targets --all-features --manifest-path ofdb-gateways/Cargo.toml
- name: Check ofdb-webserver crate
run: |
cargo check --locked --all-targets --all-features --manifest-path ofdb-webserver/Cargo.toml
- name: Check ofdb-app-clearance crate
run: |
cargo check --locked --all-targets --all-features --manifest-path ofdb-app-clearance/Cargo.toml
- name: Build workspace tests
uses: actions-rs/cargo@v1
with:
command: test
args: --locked --workspace --all-targets --all-features --no-run
- name: Build tests with default features
run: |
cargo test --locked --workspace --all-targets --no-run
- name: Run tests with default features
run: |
cargo test --locked --workspace --all-targets -- --nocapture --quiet