-
Notifications
You must be signed in to change notification settings - Fork 1
69 lines (63 loc) · 1.81 KB
/
Copy pathcheck.yml
File metadata and controls
69 lines (63 loc) · 1.81 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
60
61
62
63
64
65
66
67
68
69
# SPDX-License-Identifier: Apache-2.0
# Copyright (c) 2026 Robin Jarry
---
name: Check
permissions:
contents: read
on:
push:
branches:
- main
pull_request:
branches:
- main
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
build:
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v6
with:
persist-credentials: false
- uses: actions/setup-go@v6
with:
go-version-file: go.mod
- run: make
lint:
runs-on: ubuntu-24.04
container: fedora:latest
steps:
- run: dnf install -y make git codespell
- uses: actions/checkout@v6
with:
persist-credentials: false
fetch-depth: 0
ref: ${{ github.event.pull_request.head.sha || github.ref }}
- run: git config --global --add safe.directory $PWD
- uses: actions/setup-go@v6
with:
go-version-file: go.mod
- run: |
set -xe
git rebase --exec "git --no-pager log --oneline -1" \
--exec "make lint" "HEAD~${{ github.event.pull_request.commits }}"
if: ${{ github.event.pull_request.commits }}
- run: make lint
if: ${{ ! github.event.pull_request.commits }}
commits:
runs-on: ubuntu-24.04
if: ${{ github.event.pull_request.commits }}
container: fedora:latest
env:
REVISION_RANGE: "HEAD~${{ github.event.pull_request.commits }}.."
steps:
- run: dnf install -y make git codespell curl jq
- uses: actions/checkout@v6
with:
persist-credentials: false
fetch-depth: 0
ref: ${{ github.event.pull_request.head.sha || github.ref }}
- run: git config --global --add safe.directory $PWD
- run: make check-commits