Bump actions/upload-pages-artifact from 3 to 4 #204
This file contains hidden or 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: CI | |
on: | |
push: | |
branches: | |
- main | |
- 'pipelines/*' | |
paths-ignore: | |
- '**.md' | |
- 'docs/**' | |
- 'LICENSE' | |
- '.gitignore' | |
- '.dockerignore' | |
- '**/*.txt' | |
pull_request: | |
branches: [ main ] | |
paths-ignore: | |
- '**.md' | |
- 'docs/**' | |
- 'LICENSE' | |
- '.gitignore' | |
- '.dockerignore' | |
- '**/*.txt' | |
env: | |
GO_VERSION: 1.24.x | |
GOLANGCILINT_VERSION: "1.64.8" | |
permissions: | |
contents: read | |
pull-requests: read | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
go-version: ['1.24'] | |
steps: | |
- name: Configure Go | |
uses: actions/setup-go@v5 | |
with: | |
go-version: ${{ matrix.go-version }} | |
cache: true | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Verify dependencies | |
run: go mod verify | |
- name: Download dependencies | |
run: go mod download | |
- name: Run go vet | |
run: go vet ./... | |
- name: Run go fmt check | |
run: make fmt && git diff --exit-code | |
- name: Build | |
run: make build | |
- name: Run tests | |
run: make test-race | |
- name: Upload coverage to Codecov | |
uses: codecov/codecov-action@v5 | |
with: | |
file: ./coverage.out | |
flags: unittests | |
name: codecov-umbrella | |
fail_ci_if_error: false | |
lint: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Configure Go | |
uses: actions/setup-go@v5 | |
with: | |
go-version: ${{ env.GO_VERSION }} | |
cache: true | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: golangci-lint | |
uses: golangci/golangci-lint-action@v6 | |
with: | |
version: v${{ env.GOLANGCILINT_VERSION }} | |
args: --timeout=10m --max-same-issues=0 --max-issues-per-linter=0 | |
- name: betteralign checks | |
run: | | |
go install github.com/dkorunic/betteralign/cmd/betteralign@latest | |
output=$(betteralign ./...) | |
if [ -n "$output" ]; then | |
echo "Struct alignment issues found:" | |
echo "$output" | |
exit 1 | |
fi | |
cross-platform: | |
name: Cross-Platform Build Validation | |
strategy: | |
matrix: | |
os: [ubuntu-latest, macos-latest, windows-latest] | |
runs-on: ${{ matrix.os }} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Set up QEMU for ARM64 emulation (Linux only) | |
if: runner.os == 'Linux' | |
uses: docker/setup-qemu-action@v3 | |
with: | |
platforms: linux/arm64 | |
- name: Configure Go | |
uses: actions/setup-go@v5 | |
with: | |
go-version: ${{ env.GO_VERSION }} | |
cache: true | |
- name: Build and test native platform | |
run: | | |
if [ "${{ runner.os }}" = "Linux" ]; then | |
make validate-linux | |
elif [ "${{ runner.os }}" = "macOS" ]; then | |
make validate-darwin | |
elif [ "${{ runner.os }}" = "Windows" ]; then | |
make validate-windows | |
fi | |
shell: bash | |
- name: Verify release build | |
run: | | |
make build-release | |
echo "Testing built binary..." | |
if [ "${{ runner.os }}" = "Windows" ]; then | |
./bin/olla.exe --version | |
else | |
./bin/olla --version | |
fi | |
shell: bash |