-
Notifications
You must be signed in to change notification settings - Fork 10
59 lines (54 loc) · 1.78 KB
/
Copy pathlint.yml
File metadata and controls
59 lines (54 loc) · 1.78 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
# SPDX-FileCopyrightText: Yalan Zhang <yalzhang@redhat.com>
# SPDX-FileCopyrightText: Timothée Ravier <tim@siosm.fr>
# SPDX-FileCopyrightText: Jakob Naucke <jnaucke@redhat.com>
#
# SPDX-License-Identifier: CC0-1.0
# Inspired by https://github.com/coreos/repo-templates
name: "Lint"
on:
pull_request:
branches:
- "main"
permissions:
contents: "read"
# Don't waste job slots on superseded code
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
env:
CARGO_TERM_COLOR: always
# Pinned toolchain for linting
ACTIONS_LINTS_TOOLCHAIN: 1.88.0
jobs:
linting:
name: "Lints, pinned toolchain"
runs-on: "ubuntu-24.04"
container: "ghcr.io/trusted-execution-clusters/buildroot:fedora"
steps:
- name: "Check out repository"
uses: actions/checkout@v7
- name: "Install Rust toolchain"
uses: dtolnay/rust-toolchain@v1
with:
toolchain: ${{ env.ACTIONS_LINTS_TOOLCHAIN }}
components: rustfmt, clippy
- name: "Install Go toolchain"
uses: actions/setup-go@v6
with:
go-version-file: go.mod
- name: "Cache build artifacts"
uses: Swatinem/rust-cache@v2
- name: "Build CRDs"
run: make crds-rs
- name: "cargo fmt (check)"
run: cargo fmt -- --check -l
- name: "cargo clippy (warnings)"
run: cargo clippy --all-targets --all-features -- -D warnings
- name: "gofmt (check)"
run: if [ -n "$(gofmt -l .)" ]; then exit 1; fi
- name: "go vet"
run: go vet ./...
- name: "Ensure Rust & Go conditions definitions use same strings"
run: cargo test --test equal_conditions
- name: "Ensure no disallowed crypto crates are shipped"
run: cargo test --test no_disallowed_crypto