-
Notifications
You must be signed in to change notification settings - Fork 271
142 lines (134 loc) · 4.77 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
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
name: Pull Request
on: pull_request
env:
CARGO_INCREMENTAL: 0
CARGO_NET_RETRY: 10
RUSTUP_MAX_RETRIES: 10
RUSTFLAGS: "-D warnings -D deprecated -C debuginfo=0"
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref }}
cancel-in-progress: true
jobs:
meta:
timeout-minutes: 5
runs-on: ubuntu-latest
steps:
- id: build
uses: tj-actions/changed-files@800a2825992141ddde1a8bca8ad394cec34d3188
with:
files: |
.github/workflows/pr.yml
justfile
Dockerfile
- id: cargo
uses: tj-actions/changed-files@800a2825992141ddde1a8bca8ad394cec34d3188
with:
files_ignore: 'Cargo.toml'
files: |
**/Cargo.toml
- id: rust
uses: tj-actions/changed-files@800a2825992141ddde1a8bca8ad394cec34d3188
with:
files: |
**/*.rs
Cargo.lock
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11
- id: cargo-crates
if: steps.cargo.outputs.any_changed
run: ./.github/list-crates.sh ${{ steps.cargo.outputs.all_changed_files }}
- run: |
echo 'build: ${{ steps.build.outputs.all_changed_files }}'
echo 'cargo: ${{ steps.cargo.outputs.all_changed_files }}'
echo 'crates: ${{ steps.cargo-crates.outputs.crates }}'
echo 'rust: ${{ steps.rust.outputs.all_changed_files }}'
outputs:
any_changed: ${{ steps.build.outputs.any_changed || steps.cargo.outputs.any_changed || steps.rust.outputs.any_changed }}
build_changed: ${{ steps.build.outputs.any_changed }}
cargo_changed: ${{ steps.cargo.outputs.any_changed }}
cargo_crates: ${{ steps.cargo-crates.outputs.crates }}
rust_changed: ${{ steps.rust.outputs.any_changed }}
rust:
needs: meta
if: needs.meta.outputs.any_changed == 'true'
runs-on: ubuntu-latest
container: ghcr.io/linkerd/dev:v43-rust
permissions:
contents: read
timeout-minutes: 20
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11
- run: git config --global --add safe.directory "$PWD" # actions/runner#2033
- run: just fetch
- name: cargo deny check bans licenses sources
uses: EmbarkStudios/cargo-deny-action@64015a69ee7ee08f6c56455089cdaf6ad974fd15
with:
command: check bans licenses sources
- run: just check-fmt
- run: just clippy
- run: just doc
- run: just test --exclude=linkerd2-proxy --no-run
- run: just test --exclude=linkerd2-proxy
rust-crates:
needs: meta
if: needs.meta.outputs.cargo_changed == 'true'
timeout-minutes: 20
runs-on: ubuntu-latest
container: ghcr.io/linkerd/dev:v43-rust
strategy:
matrix:
crate: ${{ fromJson(needs.meta.outputs.cargo_crates) }}
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11
- run: git config --global --add safe.directory "$PWD" # actions/runner#2033
- run: just fetch
- run: just check-crate ${{ matrix.crate }}
linkerd-install:
needs: meta
if: needs.meta.outputs.any_changed == 'true'
timeout-minutes: 20
runs-on: ubuntu-latest
steps:
- uses: linkerd/dev/actions/setup-tools@v43
- name: scurl https://run.linkerd.io/install-edge | sh
run: |
scurl https://run.linkerd.io/install-edge | sh
echo "PATH=$PATH:$HOME/.linkerd2/bin" >> "$GITHUB_ENV"
export PATH="$PATH:$HOME/.linkerd2/bin"
tag=$(linkerd version --client --short)
echo "linkerd $tag"
echo "LINKERD_TAG=$tag" >> "$GITHUB_ENV"
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11
- run: just docker
- run: just-k3d create
- run: just k3d-load-linkerd
- run: just linkerd-install
- run: just linkerd-check-contol-plane-proxy
env:
TMPDIR: ${{ runner.temp }}
ok:
timeout-minutes: 3
needs: [rust, rust-crates, linkerd-install]
if: always()
runs-on: ubuntu-latest
steps:
- name: Info
run: |
echo 'Actor: ${{ github.actor }}'
echo 'Event: ${{ github.event_name }}'
echo 'Rust: ${{ needs.rust.result }}'
echo 'Crates: ${{ needs.rust-crates.result }}'
echo 'Install: ${{ needs.linkerd-install.result }}'
- if: contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled')
run: exit 1
auto-merge:
needs: ok
if: github.actor == 'dependabot[bot]'
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11
- run: gh pr merge '${{ github.event.pull_request.number }}' --auto --merge
env:
GH_TOKEN: ${{ github.token }}