-
Notifications
You must be signed in to change notification settings - Fork 0
89 lines (89 loc) · 2.91 KB
/
pr.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
78
79
80
81
82
83
84
85
86
87
88
89
---
# DO NOT EDIT
# Created from template "pr.yml".
name: pr
"on":
- workflow_dispatch
jobs:
project-matrixes:
runs-on: ubuntu-latest
if: "!contains(github.event.head_commit.message, 'skip ci')"
environment: publish
env:
RUSTFLAGS: "-D warnings"
GITHUB_TOKEN: "${{ secrets.DEPLOY_TOKEN }}"
GITHUB_USER: "${{ github.actor }}"
outputs:
cargo-matrix: "${{ steps.find-cargo-matrix.outputs.matrix }}"
all-matrix: "${{ steps.find-all-matrix.outputs.matrix }}"
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Get versio
uses: chaaz/versio-actions/[email protected]
- name: Find cargo matrix
id: find-cargo-matrix
run: "echo matrix={\\\"include\\\":$(versio -l none info -l cargo -R -N)} >> $GITHUB_OUTPUT"
- name: Find all matrix
id: find-all-matrix
run: "echo matrix={\\\"include\\\":$(versio -l none info -a -R -N)} >> $GITHUB_OUTPUT"
versio-checks:
runs-on: ubuntu-latest
if: "!contains(github.event.head_commit.message, 'skip ci')"
environment: publish
env:
RUSTFLAGS: "-D warnings"
GITHUB_TOKEN: "${{ secrets.DEPLOY_TOKEN }}"
GITHUB_USER: "${{ github.actor }}"
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Get versio
uses: chaaz/versio-actions/[email protected]
- name: Fetch history
run: git fetch --unshallow
- name: Check projects
run: versio -l remote check
- name: Output plan
run: versio -l remote plan
cargo-checks:
needs: project-matrixes
runs-on: ubuntu-latest
strategy:
matrix: "${{ fromJson(needs.project-matrixes.outputs.cargo-matrix) }}"
if: "!contains(github.event.head_commit.message, 'skip ci')"
environment: publish
env:
RUSTFLAGS: "-D warnings"
GITHUB_TOKEN: "${{ secrets.DEPLOY_TOKEN }}"
GITHUB_USER: "${{ github.actor }}"
defaults:
run:
working-directory: "${{ matrix.root }}"
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Get cargo stable
uses: actions-rs/toolchain@v1
with:
toolchain: stable
components: clippy
- name: Get cargo nightly
uses: actions-rs/toolchain@v1
with:
toolchain: nightly
components: rustfmt
- name: Find paths
id: cargo-find-paths
run: "echo \"cargo-lock-glob=\\\"${{ matrix.root }}\\\"/**/Cargo.lock\" >> $GITHUB_OUTPUT"
- name: Cache cargo and target
uses: actions/cache@v1
with:
path: "~/.cargo/registry\n~/.cargo/git\n${{ matrix.root }}/target\n"
key: "${{ runner.os }}-cargo-${{ hashFiles(steps.cargo-find-paths.outputs.cargo-lock-glob) }}"
- name: Check structure
run: cargo clippy
- name: Check format
run: cargo +nightly fmt -- --check
- name: Check tests
run: cargo test