-
Notifications
You must be signed in to change notification settings - Fork 9
58 lines (48 loc) · 1.47 KB
/
run-distros.yaml
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
name: Run Distros Framework
on:
push:
pull_request:
branches: [ main ]
permissions:
contents: read
jobs:
build:
name: Build and Lint
runs-on: ubuntu-latest
timeout-minutes: 20
steps:
- name: Checkout distros
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Cache Go Modules
uses: actions/cache@v4
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: Build Docker image
run: docker build . -q -f scripts/Dockerfile.build -t acceptance-tests
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: '1.22'
- name: Get list of changed files
id: get-changed-files
run: |
files=$(git diff --name-only ${{ github.event.pull_request.base.sha }} ${{ github.sha }} | grep '.*\.go$' || true)
if [ -z "$files" ]; then
echo "No Go files changed in this PR"
echo "go_files_changed=false" >> $GITHUB_OUTPUT
else
echo "Go Changed files: $files"
echo "go_files_changed=true" >> $GITHUB_OUTPUT
fi
- name: golangci-lint
if: steps.get-changed-files.outputs.go_files_changed == 'true'
uses: golangci/golangci-lint-action@v6
with:
version: v1.55.2
args: --timeout 10m
continue-on-error: false