82 lines
2.3 KiB
YAML
82 lines
2.3 KiB
YAML
name: Pull request checks
|
|
|
|
on: [pull_request]
|
|
|
|
jobs:
|
|
test:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5
|
|
|
|
- uses: actions/setup-go@44694675825211faa026b3c33043df3e48a5fa00 # v6
|
|
with:
|
|
go-version: '1.24'
|
|
|
|
- name: Run unit tests
|
|
run: |
|
|
cd tools
|
|
go test ./...
|
|
|
|
lint:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5
|
|
|
|
- uses: actions/setup-go@44694675825211faa026b3c33043df3e48a5fa00 # v6
|
|
with:
|
|
go-version: '1.24'
|
|
|
|
- name: Run linter
|
|
uses: golangci/golangci-lint-action@4afd733a84b1f43292c63897423277bb7f4313a9 # v8
|
|
with:
|
|
working-directory: tools
|
|
args: --timeout=5m
|
|
|
|
formatting-is-valid:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5
|
|
|
|
- uses: actions/setup-go@44694675825211faa026b3c33043df3e48a5fa00 # v6
|
|
with:
|
|
go-version: '1.24'
|
|
|
|
- name: Ensure that files are formatted correctly
|
|
run: |
|
|
scripts/build-tools.sh
|
|
bin/image-mirror-tools format
|
|
# fail if there are changes in the working tree
|
|
git diff --exit-code
|
|
|
|
regsync-yaml-synced:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5
|
|
|
|
- uses: actions/setup-go@44694675825211faa026b3c33043df3e48a5fa00 # v6
|
|
with:
|
|
go-version: '1.24'
|
|
|
|
- name: Ensure that regsync.yaml is in sync with config.yaml
|
|
run: |
|
|
scripts/build-tools.sh
|
|
bin/image-mirror-tools generate-regsync
|
|
# fail if there are changes in the working tree
|
|
git diff --exit-code
|
|
|
|
run-validate-subcommand:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5
|
|
with:
|
|
fetch-depth: 0
|
|
|
|
- uses: actions/setup-go@44694675825211faa026b3c33043df3e48a5fa00 # v6
|
|
with:
|
|
go-version: '1.24'
|
|
|
|
- name: Run bin/image-mirror-tools validate
|
|
run: |
|
|
scripts/build-tools.sh
|
|
bin/image-mirror-tools validate --merge-base-branch origin/master
|