annotate .github/workflows/build.yml @ 36:d1f0c1cf3c6e

Github actions publish crate
author Nigma <magnusgsvend@gmail.com>
date Sun, 24 Jul 2022 02:05:30 +0200
parents 86113e45f88f
children a132009ecc5c
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
33
86113e45f88f Add Github actions to help manage PRs
Anthony Nowell <anthony.nowell@windriver.com>
parents:
diff changeset
1 on:
86113e45f88f Add Github actions to help manage PRs
Anthony Nowell <anthony.nowell@windriver.com>
parents:
diff changeset
2 pull_request:
86113e45f88f Add Github actions to help manage PRs
Anthony Nowell <anthony.nowell@windriver.com>
parents:
diff changeset
3 branches:
86113e45f88f Add Github actions to help manage PRs
Anthony Nowell <anthony.nowell@windriver.com>
parents:
diff changeset
4 - master
86113e45f88f Add Github actions to help manage PRs
Anthony Nowell <anthony.nowell@windriver.com>
parents:
diff changeset
5 workflow_call:
86113e45f88f Add Github actions to help manage PRs
Anthony Nowell <anthony.nowell@windriver.com>
parents:
diff changeset
6
86113e45f88f Add Github actions to help manage PRs
Anthony Nowell <anthony.nowell@windriver.com>
parents:
diff changeset
7 name: Build
86113e45f88f Add Github actions to help manage PRs
Anthony Nowell <anthony.nowell@windriver.com>
parents:
diff changeset
8
86113e45f88f Add Github actions to help manage PRs
Anthony Nowell <anthony.nowell@windriver.com>
parents:
diff changeset
9 jobs:
86113e45f88f Add Github actions to help manage PRs
Anthony Nowell <anthony.nowell@windriver.com>
parents:
diff changeset
10 check:
86113e45f88f Add Github actions to help manage PRs
Anthony Nowell <anthony.nowell@windriver.com>
parents:
diff changeset
11 name: Check & Lint
86113e45f88f Add Github actions to help manage PRs
Anthony Nowell <anthony.nowell@windriver.com>
parents:
diff changeset
12 runs-on: ubuntu-latest
86113e45f88f Add Github actions to help manage PRs
Anthony Nowell <anthony.nowell@windriver.com>
parents:
diff changeset
13 steps:
86113e45f88f Add Github actions to help manage PRs
Anthony Nowell <anthony.nowell@windriver.com>
parents:
diff changeset
14 - name: Checkout sources
86113e45f88f Add Github actions to help manage PRs
Anthony Nowell <anthony.nowell@windriver.com>
parents:
diff changeset
15 uses: actions/checkout@v2
86113e45f88f Add Github actions to help manage PRs
Anthony Nowell <anthony.nowell@windriver.com>
parents:
diff changeset
16
86113e45f88f Add Github actions to help manage PRs
Anthony Nowell <anthony.nowell@windriver.com>
parents:
diff changeset
17 - name: Install PAM dev files
86113e45f88f Add Github actions to help manage PRs
Anthony Nowell <anthony.nowell@windriver.com>
parents:
diff changeset
18 run: sudo apt-get install -y libpam0g-dev
86113e45f88f Add Github actions to help manage PRs
Anthony Nowell <anthony.nowell@windriver.com>
parents:
diff changeset
19
86113e45f88f Add Github actions to help manage PRs
Anthony Nowell <anthony.nowell@windriver.com>
parents:
diff changeset
20 - name: Use cargo cache
86113e45f88f Add Github actions to help manage PRs
Anthony Nowell <anthony.nowell@windriver.com>
parents:
diff changeset
21 uses: actions/cache@v2
86113e45f88f Add Github actions to help manage PRs
Anthony Nowell <anthony.nowell@windriver.com>
parents:
diff changeset
22 with:
86113e45f88f Add Github actions to help manage PRs
Anthony Nowell <anthony.nowell@windriver.com>
parents:
diff changeset
23 path: |
86113e45f88f Add Github actions to help manage PRs
Anthony Nowell <anthony.nowell@windriver.com>
parents:
diff changeset
24 ~/.cargo/bin/
86113e45f88f Add Github actions to help manage PRs
Anthony Nowell <anthony.nowell@windriver.com>
parents:
diff changeset
25 ~/.cargo/registry/index/
86113e45f88f Add Github actions to help manage PRs
Anthony Nowell <anthony.nowell@windriver.com>
parents:
diff changeset
26 ~/.cargo/registry/cache/
86113e45f88f Add Github actions to help manage PRs
Anthony Nowell <anthony.nowell@windriver.com>
parents:
diff changeset
27 ~/.cargo/git/db/
86113e45f88f Add Github actions to help manage PRs
Anthony Nowell <anthony.nowell@windriver.com>
parents:
diff changeset
28 target/
86113e45f88f Add Github actions to help manage PRs
Anthony Nowell <anthony.nowell@windriver.com>
parents:
diff changeset
29 key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
86113e45f88f Add Github actions to help manage PRs
Anthony Nowell <anthony.nowell@windriver.com>
parents:
diff changeset
30
86113e45f88f Add Github actions to help manage PRs
Anthony Nowell <anthony.nowell@windriver.com>
parents:
diff changeset
31 - name: Install stable toolchain
86113e45f88f Add Github actions to help manage PRs
Anthony Nowell <anthony.nowell@windriver.com>
parents:
diff changeset
32 uses: actions-rs/toolchain@v1
86113e45f88f Add Github actions to help manage PRs
Anthony Nowell <anthony.nowell@windriver.com>
parents:
diff changeset
33 with:
86113e45f88f Add Github actions to help manage PRs
Anthony Nowell <anthony.nowell@windriver.com>
parents:
diff changeset
34 profile: minimal
86113e45f88f Add Github actions to help manage PRs
Anthony Nowell <anthony.nowell@windriver.com>
parents:
diff changeset
35 toolchain: stable
86113e45f88f Add Github actions to help manage PRs
Anthony Nowell <anthony.nowell@windriver.com>
parents:
diff changeset
36 override: true
86113e45f88f Add Github actions to help manage PRs
Anthony Nowell <anthony.nowell@windriver.com>
parents:
diff changeset
37
86113e45f88f Add Github actions to help manage PRs
Anthony Nowell <anthony.nowell@windriver.com>
parents:
diff changeset
38 - name: Run cargo check
86113e45f88f Add Github actions to help manage PRs
Anthony Nowell <anthony.nowell@windriver.com>
parents:
diff changeset
39 uses: actions-rs/cargo@v1
86113e45f88f Add Github actions to help manage PRs
Anthony Nowell <anthony.nowell@windriver.com>
parents:
diff changeset
40 with:
86113e45f88f Add Github actions to help manage PRs
Anthony Nowell <anthony.nowell@windriver.com>
parents:
diff changeset
41 command: check
86113e45f88f Add Github actions to help manage PRs
Anthony Nowell <anthony.nowell@windriver.com>
parents:
diff changeset
42 args: --manifest-path pam/Cargo.toml
86113e45f88f Add Github actions to help manage PRs
Anthony Nowell <anthony.nowell@windriver.com>
parents:
diff changeset
43
86113e45f88f Add Github actions to help manage PRs
Anthony Nowell <anthony.nowell@windriver.com>
parents:
diff changeset
44 - name: Run cargo test
86113e45f88f Add Github actions to help manage PRs
Anthony Nowell <anthony.nowell@windriver.com>
parents:
diff changeset
45 uses: actions-rs/cargo@v1
86113e45f88f Add Github actions to help manage PRs
Anthony Nowell <anthony.nowell@windriver.com>
parents:
diff changeset
46 with:
86113e45f88f Add Github actions to help manage PRs
Anthony Nowell <anthony.nowell@windriver.com>
parents:
diff changeset
47 command: test
86113e45f88f Add Github actions to help manage PRs
Anthony Nowell <anthony.nowell@windriver.com>
parents:
diff changeset
48 args: --manifest-path pam/Cargo.toml
86113e45f88f Add Github actions to help manage PRs
Anthony Nowell <anthony.nowell@windriver.com>
parents:
diff changeset
49
86113e45f88f Add Github actions to help manage PRs
Anthony Nowell <anthony.nowell@windriver.com>
parents:
diff changeset
50 - name: Run cargo check on pam-http
86113e45f88f Add Github actions to help manage PRs
Anthony Nowell <anthony.nowell@windriver.com>
parents:
diff changeset
51 uses: actions-rs/cargo@v1
86113e45f88f Add Github actions to help manage PRs
Anthony Nowell <anthony.nowell@windriver.com>
parents:
diff changeset
52 with:
86113e45f88f Add Github actions to help manage PRs
Anthony Nowell <anthony.nowell@windriver.com>
parents:
diff changeset
53 command: check
86113e45f88f Add Github actions to help manage PRs
Anthony Nowell <anthony.nowell@windriver.com>
parents:
diff changeset
54 args: --manifest-path pam-http/Cargo.toml
86113e45f88f Add Github actions to help manage PRs
Anthony Nowell <anthony.nowell@windriver.com>
parents:
diff changeset
55
86113e45f88f Add Github actions to help manage PRs
Anthony Nowell <anthony.nowell@windriver.com>
parents:
diff changeset
56 - name: Run cargo check on pam-sober
86113e45f88f Add Github actions to help manage PRs
Anthony Nowell <anthony.nowell@windriver.com>
parents:
diff changeset
57 uses: actions-rs/cargo@v1
86113e45f88f Add Github actions to help manage PRs
Anthony Nowell <anthony.nowell@windriver.com>
parents:
diff changeset
58 with:
86113e45f88f Add Github actions to help manage PRs
Anthony Nowell <anthony.nowell@windriver.com>
parents:
diff changeset
59 command: check
86113e45f88f Add Github actions to help manage PRs
Anthony Nowell <anthony.nowell@windriver.com>
parents:
diff changeset
60 args: --manifest-path pam-sober/Cargo.toml
86113e45f88f Add Github actions to help manage PRs
Anthony Nowell <anthony.nowell@windriver.com>
parents:
diff changeset
61
86113e45f88f Add Github actions to help manage PRs
Anthony Nowell <anthony.nowell@windriver.com>
parents:
diff changeset
62 - name: Run cargo fmt
86113e45f88f Add Github actions to help manage PRs
Anthony Nowell <anthony.nowell@windriver.com>
parents:
diff changeset
63 uses: actions-rs/cargo@v1
86113e45f88f Add Github actions to help manage PRs
Anthony Nowell <anthony.nowell@windriver.com>
parents:
diff changeset
64 with:
86113e45f88f Add Github actions to help manage PRs
Anthony Nowell <anthony.nowell@windriver.com>
parents:
diff changeset
65 command: fmt
86113e45f88f Add Github actions to help manage PRs
Anthony Nowell <anthony.nowell@windriver.com>
parents:
diff changeset
66 args: --manifest-path pam/Cargo.toml --all --check
86113e45f88f Add Github actions to help manage PRs
Anthony Nowell <anthony.nowell@windriver.com>
parents:
diff changeset
67
86113e45f88f Add Github actions to help manage PRs
Anthony Nowell <anthony.nowell@windriver.com>
parents:
diff changeset
68 - name: Run cargo clippy
86113e45f88f Add Github actions to help manage PRs
Anthony Nowell <anthony.nowell@windriver.com>
parents:
diff changeset
69 uses: actions-rs/cargo@v1
86113e45f88f Add Github actions to help manage PRs
Anthony Nowell <anthony.nowell@windriver.com>
parents:
diff changeset
70 with:
86113e45f88f Add Github actions to help manage PRs
Anthony Nowell <anthony.nowell@windriver.com>
parents:
diff changeset
71 command: clippy
86113e45f88f Add Github actions to help manage PRs
Anthony Nowell <anthony.nowell@windriver.com>
parents:
diff changeset
72 args: --manifest-path pam/Cargo.toml -- -D warnings
36
d1f0c1cf3c6e Github actions publish crate
Nigma <magnusgsvend@gmail.com>
parents: 33
diff changeset
73 build:
d1f0c1cf3c6e Github actions publish crate
Nigma <magnusgsvend@gmail.com>
parents: 33
diff changeset
74 needs: check
d1f0c1cf3c6e Github actions publish crate
Nigma <magnusgsvend@gmail.com>
parents: 33
diff changeset
75 runs-on: ubuntu-latest
d1f0c1cf3c6e Github actions publish crate
Nigma <magnusgsvend@gmail.com>
parents: 33
diff changeset
76 steps:
d1f0c1cf3c6e Github actions publish crate
Nigma <magnusgsvend@gmail.com>
parents: 33
diff changeset
77 - name: Use cargo cache
d1f0c1cf3c6e Github actions publish crate
Nigma <magnusgsvend@gmail.com>
parents: 33
diff changeset
78 uses: actions/cache@v2
d1f0c1cf3c6e Github actions publish crate
Nigma <magnusgsvend@gmail.com>
parents: 33
diff changeset
79 with:
d1f0c1cf3c6e Github actions publish crate
Nigma <magnusgsvend@gmail.com>
parents: 33
diff changeset
80 path: |
d1f0c1cf3c6e Github actions publish crate
Nigma <magnusgsvend@gmail.com>
parents: 33
diff changeset
81 ~/.cargo/bin/
d1f0c1cf3c6e Github actions publish crate
Nigma <magnusgsvend@gmail.com>
parents: 33
diff changeset
82 ~/.cargo/registry/index/
d1f0c1cf3c6e Github actions publish crate
Nigma <magnusgsvend@gmail.com>
parents: 33
diff changeset
83 ~/.cargo/registry/cache/
d1f0c1cf3c6e Github actions publish crate
Nigma <magnusgsvend@gmail.com>
parents: 33
diff changeset
84 ~/.cargo/git/db/
d1f0c1cf3c6e Github actions publish crate
Nigma <magnusgsvend@gmail.com>
parents: 33
diff changeset
85 target/
d1f0c1cf3c6e Github actions publish crate
Nigma <magnusgsvend@gmail.com>
parents: 33
diff changeset
86 key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
33
86113e45f88f Add Github actions to help manage PRs
Anthony Nowell <anthony.nowell@windriver.com>
parents:
diff changeset
87
36
d1f0c1cf3c6e Github actions publish crate
Nigma <magnusgsvend@gmail.com>
parents: 33
diff changeset
88 - name: Install stable toolchain
d1f0c1cf3c6e Github actions publish crate
Nigma <magnusgsvend@gmail.com>
parents: 33
diff changeset
89 uses: actions-rs/toolchain@v1
d1f0c1cf3c6e Github actions publish crate
Nigma <magnusgsvend@gmail.com>
parents: 33
diff changeset
90 with:
d1f0c1cf3c6e Github actions publish crate
Nigma <magnusgsvend@gmail.com>
parents: 33
diff changeset
91 profile: minimal
d1f0c1cf3c6e Github actions publish crate
Nigma <magnusgsvend@gmail.com>
parents: 33
diff changeset
92 toolchain: stable
d1f0c1cf3c6e Github actions publish crate
Nigma <magnusgsvend@gmail.com>
parents: 33
diff changeset
93 override: true
d1f0c1cf3c6e Github actions publish crate
Nigma <magnusgsvend@gmail.com>
parents: 33
diff changeset
94 - name: Publish module
d1f0c1cf3c6e Github actions publish crate
Nigma <magnusgsvend@gmail.com>
parents: 33
diff changeset
95 uses: katyo/publish-crates@v1
d1f0c1cf3c6e Github actions publish crate
Nigma <magnusgsvend@gmail.com>
parents: 33
diff changeset
96 with:
d1f0c1cf3c6e Github actions publish crate
Nigma <magnusgsvend@gmail.com>
parents: 33
diff changeset
97 registry-token: ${{ secrets.CARGO_REGISTRY_TOKEN }}
d1f0c1cf3c6e Github actions publish crate
Nigma <magnusgsvend@gmail.com>
parents: 33
diff changeset
98 check-repo: ${{ github.event_name == 'push' }}
d1f0c1cf3c6e Github actions publish crate
Nigma <magnusgsvend@gmail.com>
parents: 33
diff changeset
99 ignore-unpublished-changes: true
d1f0c1cf3c6e Github actions publish crate
Nigma <magnusgsvend@gmail.com>
parents: 33
diff changeset
100 # Only publish pam module, as pam-http and pam-sober are example projects
d1f0c1cf3c6e Github actions publish crate
Nigma <magnusgsvend@gmail.com>
parents: 33
diff changeset
101 args: --package pam-bindings
33
86113e45f88f Add Github actions to help manage PRs
Anthony Nowell <anthony.nowell@windriver.com>
parents:
diff changeset
102