Skip to content

Prepare release v0.11.1 #602

Prepare release v0.11.1

Prepare release v0.11.1 #602

Workflow file for this run

name: Tests
on:
push:
branches:
- main
pull_request:
jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Setup Go
uses: actions/setup-go@v3
with:
go-version: '1.23.x'
- name: Install dependencies
run: go get .
- name: Build Linux
run: GOOS=linux GOARCH=amd64 go build .
- name: Build Windows
run: GOOS=windows GOARCH=amd64 go build .
- name: Build MacOS
run: GOOS=darwin GOARCH=amd64 go build .
test:
name: Run tests
runs-on: ubuntu-latest
steps:
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: '1.23.x'
- name: Check out code
uses: actions/checkout@v2
- name: Install magic CLI
run: |
curl -ssL https://magic.modular.com | bash
source /home/runner/.bash_profile
- name: Install mojo and dependencies
run: |
source /home/runner/.bash_profile
cd test
magic install --locked
- name: Generate JSON test docs
run: |
source /home/runner/.bash_profile
cd test
magic run mojo doc -o docs/test.json src
- name: Install dependencies
run: |
go get .
- name: Run Unit tests
run: |
go test -v -covermode atomic -coverprofile="coverage.out" -coverpkg=./internal/... ./...
go tool cover -func="coverage.out"
- name: Coveralls
uses: coverallsapp/github-action@v2
with:
path-to-lcov: coverage.out
lint:
name: Run linters
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Setup Go
uses: actions/setup-go@v3
with:
go-version: '1.23.x'
- name: Install dependencies
run: |
go get .
go install honnef.co/go/tools/cmd/staticcheck@latest
go install github.com/gordonklaus/ineffassign@latest
- name: Check format
run: |
if gofmt -e -l . >&1 | grep '^'; then
exit 1
fi
- name: Lint with vet
run: go vet ./...
- name: Lint with vet (tiny)
run: go vet -tags tiny ./...
- name: Lint with staticcheck
run: staticcheck ./...
- name: Lint with staticcheck (tiny)
run: staticcheck -tags tiny ./...
- name: Lint with ineffassign
run: ineffassign ./...
semver:
name: Run SemVer check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Setup Go
uses: actions/setup-go@v3
with:
go-version: '1.23.x'
- name: Install dependencies
run: |
go get .
go install golang.org/x/exp/cmd/gorelease@latest
- name: Get latest tag
uses: actions-ecosystem/action-get-latest-tag@v1
id: latest-tag
- name: Run gorelease
run: gorelease -base=${{ steps.latest-tag.outputs.tag }}