return error instead of panicking upon branch hijacking #265
Workflow file for this run
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: CI | |
on: | |
pull_request: | |
branches: | |
- main | |
push: | |
branches: | |
- main | |
jobs: | |
test-unit: | |
runs-on: ubuntu-latest | |
container: | |
image: golang:1.20.7-bookworm | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- uses: actions/cache@v3 | |
with: | |
path: /go/pkg/mod | |
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} | |
restore-keys: | | |
${{ runner.os }}-go- | |
- name: Run unit tests | |
run: make test-unit | |
- name: Upload coverage reports | |
uses: codecov/codecov-action@v3 | |
with: | |
token: ${{ secrets.CODECOV_TOKEN }} | |
lint: | |
runs-on: ubuntu-latest | |
container: | |
image: golang:1.20.7-bookworm | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- uses: actions/cache@v3 | |
with: | |
path: /go/pkg/mod | |
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} | |
restore-keys: | | |
${{ runner.os }}-go- | |
- name: golangci-lint | |
uses: golangci/golangci-lint-action@v3 | |
with: | |
version: v1.53.3 | |
build-image: | |
needs: [test-unit, lint] | |
runs-on: ubuntu-latest | |
steps: | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v2 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v2 | |
- name: Build image | |
uses: docker/build-push-action@v3 | |
with: | |
platforms: linux/amd64,linux/arm64 | |
push: false | |
cache-from: type=gha | |
cache-to: type=gha,mode=max |