editing tests for jenkins runs #41
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.21' | |
- 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" | |
echo "::set-output name=go_files_changed::false" | |
else | |
echo "Go files changed" | |
echo "::set-output name=go_files_changed::true" | |
fi | |
- name: golangci-lint | |
if: steps.get-changed-files.outputs.go_files_changed == 'true' | |
uses: golangci/golangci-lint-action@v4 | |
with: | |
version: v1.55.2 | |
args: --timeout 10m | |
continue-on-error: false |