-
Notifications
You must be signed in to change notification settings - Fork 10
86 lines (81 loc) · 2.71 KB
/
Copy pathci.yml
File metadata and controls
86 lines (81 loc) · 2.71 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
name: ci
on:
push:
branches:
- master
pull_request:
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
nix:
permissions:
id-token: "write"
contents: "read"
runs-on: ubuntu-latest
env:
RUSTFLAGS: "-D warnings"
strategy:
fail-fast: false
matrix:
include:
- command: develop -c cargo check --locked --all
- command: develop -c cargo doc --all-features --locked --no-deps
- command: develop -c cargo fmt --all -- --check
- command: develop -c cargo test --locked --all
- command: develop -c cargo test --no-default-features --locked --all
- command: develop -c cargo test --all-features --locked --all
- command: fmt -- --ci
- command: flake check --all-systems --no-update-lock-file
- command: build --print-build-logs --no-update-lock-file .#gantz-website
steps:
- uses: actions/checkout@v5
- uses: DeterminateSystems/nix-installer-action@main
- uses: DeterminateSystems/magic-nix-cache-action@v13
- uses: Swatinem/rust-cache@v2
- run: nix ${{ matrix.command }}
cargo-publish:
needs: nix
permissions:
id-token: "write"
contents: "read"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- uses: DeterminateSystems/nix-installer-action@main
- uses: DeterminateSystems/magic-nix-cache-action@v13
- uses: nicknovitski/nix-develop@v1
- uses: Swatinem/rust-cache@v2
- uses: katyo/publish-crates@v2
id: publish-crates
with:
registry-token: ${{ secrets.CRATESIO_TOKEN }}
dry-run: ${{ github.event_name != 'push' }}
ignore-unpublished-changes: true
- name: List published crates
if: ${{ steps.publish-crates.outputs.published != '' }}
run: |
LIST="${{ join(fromJSON(steps.publish-crates.outputs.published).*.name, ', ') }}"
echo "Published crates: $LIST"
deploy-gantz-website:
needs: nix
if: github.ref == 'refs/heads/master'
permissions:
pages: write
id-token: write
contents: read
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- uses: DeterminateSystems/nix-installer-action@main
- uses: DeterminateSystems/magic-nix-cache-action@v13
- run: nix build --print-build-logs .#gantz-website
- uses: actions/configure-pages@v4
- uses: actions/upload-pages-artifact@v3
with:
path: 'result'
- id: deployment
uses: actions/deploy-pages@v4