Change CI triggers to handle pull requests as well (#140) #527
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 go tests | |
on: | |
push: | |
branches: ["main"] | |
tags: ["v*"] | |
pull_request: | |
branches: ["*"] | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Install ASDF | |
uses: asdf-vm/actions/setup@v3 | |
- name: Install matching Go toolchain | |
run: | | |
asdf plugin add golang | |
asdf install golang | |
- name: Go version | |
run: go version | |
- name: Install dependencies | |
run: go get ./... | |
- name: Build | |
run: go build -v ./... | |
- name: Test | |
run: go test -v ./... | |
- name: Goreleaser checks | |
uses: goreleaser/goreleaser-action@v4 | |
with: | |
distribution: goreleaser | |
version: latest | |
args: release --snapshot --clean | |
test-gotip: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Install ASDF | |
uses: asdf-vm/actions/setup@v3 | |
- name: Install matching Go toolchain | |
run: | | |
asdf plugin add golang | |
asdf install golang | |
- name: Install gotip | |
run: | | |
go install golang.org/dl/gotip@latest | |
asdf reshim | |
gotip download | |
- name: Go version | |
run: gotip version | |
- name: Install dependencies | |
run: gotip get ./... | |
- name: Build | |
run: gotip build -v ./... | |
- name: Test | |
run: gotip test -v ./... | |
docker-build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: 'Check Dockerfile is well-formed' | |
run: ./scripts/dockerfile_checks.sh | |
- name: 'Build Docker image' | |
run: | | |
docker build -t local-scip-go . | |
docker run local-scip-go scip-go --help | |
docker run --volume .:/sources --workdir /sources local-scip-go scip-go | |
file index.scip | |