-
Notifications
You must be signed in to change notification settings - Fork 5
78 lines (75 loc) · 2.49 KB
/
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
on:
- push
env:
NIGHTLY_TOOLCHAIN: nightly-2023-12-30
jobs:
test:
name: Run tests
runs-on: ubuntu-22.04
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Install SQLx CLI
run: |
mkdir -p ~/.local/bin
curl -L https://development-content.brioche.dev/tools/sqlx-cli_v0.7.1/sqlx -o ~/.local/bin/sqlx
curl -L https://development-content.brioche.dev/tools/sqlx-cli_v0.7.1/cargo-sqlx -o ~/.local/bin/cargo-sqlx
chmod +x ~/.local/bin/sqlx ~/.local/bin/cargo-sqlx
echo "$HOME/.local/bin" >> $GITHUB_PATH
- name: Check formatting
run: cargo fmt -- --check
- name: Check database schema
run: make check-db-schema
- name: Check Clippy
run: cargo clippy --all -- -Dwarnings
- name: Build runtime distribution
run: |
cd crates/brioche/runtime
npm install
npm run build
- name: Run tests
run: cargo test --all
build:
name: Build artifacts
runs-on: ubuntu-22.04
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Install Rust nightly toolchain
run: |
rustup toolchain install "$NIGHTLY_TOOLCHAIN" \
--target x86_64-unknown-linux-musl \
--component rust-src
- name: Build Brioche
run: cargo build --release
- name: Build brioche-pack
run: |
cargo +"$NIGHTLY_TOOLCHAIN" build \
-p brioche-pack \
--profile=release-tiny \
--target=x86_64-unknown-linux-musl \
-Z 'build-std=std,panic_abort' \
-Z 'build-std-features=panic_immediate_abort'
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: brioche
if-no-files-found: error
path: |
target/release/brioche
target/x86_64-unknown-linux-musl/release-tiny/brioche-ld
target/x86_64-unknown-linux-musl/release-tiny/brioche-packed-exec
target/x86_64-unknown-linux-musl/release-tiny/brioche-packed-userland-exec
target/x86_64-unknown-linux-musl/release-tiny/brioche-packer
push:
name: Push artifacts
if: github.ref == 'refs/heads/cicd' && github.repository == 'brioche-dev/brioche'
needs: [test, build]
runs-on: ubuntu-22.04
steps:
- name: Download artifacts
uses: actions/download-artifact@v4
with:
name: brioche
- run: ls -l
- run: tree