-
Notifications
You must be signed in to change notification settings - Fork 76
140 lines (133 loc) · 4.62 KB
/
lint.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
name: Lint
on:
pull_request:
types:
- opened
- synchronize
- reopened
- labeled
- unlabeled
merge_group:
push:
branches:
- "main"
jobs:
run_checker:
uses: ./.github/workflows/reusable-run-checker.yml
proto:
runs-on: ubuntu-latest
needs: run_checker
if: needs.run_checker.outputs.run_lint_proto == 'true'
steps:
- uses: actions/checkout@v4
- uses: bufbuild/buf-setup-action@v1
with:
version: "1.32.0"
github_token: ${{ github.token }}
- uses: bufbuild/buf-lint-action@v1
- run: buf format -d --exit-code
if: always()
# Run breaking changes against each module, running against whole workspace
# fails if new packages are added
- uses: bufbuild/buf-breaking-action@v1
if: always()
continue-on-error: ${{ contains(github.event.pull_request.labels.*.name, 'allow-breaking-proto') }}
with:
input: "proto/primitives"
against: "buf.build/astria/primitives"
- uses: bufbuild/buf-breaking-action@v1
if: always()
continue-on-error: ${{ contains(github.event.pull_request.labels.*.name, 'allow-breaking-proto') }}
with:
input: "proto/executionapis"
against: "buf.build/astria/execution-apis"
- uses: bufbuild/buf-breaking-action@v1
if: always()
continue-on-error: ${{ contains(github.event.pull_request.labels.*.name, 'allow-breaking-proto') }}
with:
input: "proto/sequencerblockapis"
against: "buf.build/astria/sequencerblock-apis"
- uses: bufbuild/buf-breaking-action@v1
if: always()
continue-on-error: ${{ contains(github.event.pull_request.labels.*.name, 'allow-breaking-proto') }}
with:
input: "proto/protocolapis"
against: "buf.build/astria/protocol-apis"
- uses: bufbuild/buf-breaking-action@v1
if: always()
continue-on-error: ${{ contains(github.event.pull_request.labels.*.name, 'allow-breaking-proto') }}
with:
input: "proto/composerapis"
against: "buf.build/astria/composer-apis"
rust:
runs-on: ubuntu-22.04
needs: run_checker
if: needs.run_checker.outputs.run_lint_rust == 'true'
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@master
with:
toolchain: nightly-2024-09-15
components: rustfmt
- name: run rustfmt
run: cargo +nightly-2024-09-15 fmt --all -- --check
toml:
runs-on: ubuntu-22.04
needs: run_checker
if: needs.run_checker.outputs.run_lint_toml == 'true'
steps:
- uses: actions/checkout@v4
- name: download taplo
run: |
curl -fsSL https://github.com/tamasfe/taplo/releases/download/0.8.1/taplo-full-linux-x86_64.gz \
| gzip -d - \
| install -m 755 /dev/stdin /usr/local/bin/taplo
- name: run taplo
run: taplo format --check
markdown:
runs-on: ubuntu-22.04
needs: run_checker
if: needs.run_checker.outputs.run_lint_markdown == 'true'
steps:
- uses: actions/checkout@v4
- uses: DavidAnson/markdownlint-cli2-action@v11
charts:
runs-on: ubuntu-latest
needs: run_checker
if: needs.run_checker.outputs.run_lint_charts == 'true'
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Helm
uses: azure/setup-helm@v4
- uses: actions/setup-python@v5
with:
python-version: '3.9'
check-latest: true
- name: Setup helm repos
run: |
helm repo add bitnami https://charts.bitnami.com/bitnami
helm repo add blockscout https://blockscout.github.io/helm-charts
helm dependency build charts/evm-rollup
helm dependency build charts/evm-stack
helm dependency build charts/sequencer
- name: Set up chart-testing
uses: helm/chart-testing-action@v2.6.1
- name: Run chart-testing (list-changed)
id: list-changed
run: |
changed=$(ct list-changed --target-branch ${{ github.event.repository.default_branch }})
if [[ -n "$changed" ]]; then
echo "changed=true" >> "$GITHUB_OUTPUT"
fi
- name: Run chart-testing (lint)
if: steps.list-changed.outputs.changed == 'true'
run: ct lint --target-branch ${{ github.event.repository.default_branch }}
lint:
needs: [proto, rust, toml, markdown, charts]
if: ${{ always() && !cancelled() }}
uses: ./.github/workflows/reusable-success.yml
with:
success: ${{ !contains(needs.*.result, 'failure') }}