-
Notifications
You must be signed in to change notification settings - Fork 10
56 lines (54 loc) · 1.75 KB
/
build-check.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
name: Build and Check linting
on:
workflow_call:
inputs:
publish-artifact:
default: false
required: false
type: boolean
workflow_dispatch:
pull_request:
branches:
- main
jobs:
build_check:
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v3
- name: Install Nix packages
uses: DeterminateSystems/nix-installer-action@main
- name: Cache Nix packages
uses: DeterminateSystems/magic-nix-cache-action@main
- name: Cache rust dependencies and build output
uses: actions/cache@v3
with:
path: |
~/.cargo/
target/
key: cargo-${{ hashFiles('**/Cargo.lock') }}
- name: Rust Setup
run: |
nix-shell --run "rustup default nightly"
nix-shell --run "rustup target add x86_64-unknown-linux-musl"
nix-shell --run 'rustup target add wasm32-unknown-unknown'
nix-shell --run "rustup component add rustfmt"
nix-shell --run "rustup component add clippy"
- name: lint check
run: |
nix-shell --run "cargo fmt --check"
nix-shell --run "cargo clippy --no-deps --all-features --release -- -Dwarnings"
- name: Build the Leptos project to `musl` output
run: nix-shell --run 'cargo leptos build --release'
env:
LEPTOS_BIN_TARGET_TRIPLE: x86_64-unknown-linux-musl
- run: touch .empty
- name: Archive production artifacts
uses: actions/upload-artifact@v3
if: ${{ inputs.publish-artifact }}
with:
name: build-musl
path: |
target/x86_64-unknown-linux-musl/release/hot-or-not-web-leptos-ssr
target/site
.empty