Skip to content

ci: use supported Go versions #250

ci: use supported Go versions

ci: use supported Go versions #250

Workflow file for this run

name: build
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
run:
runs-on: ubuntu-latest
strategy:
matrix:
# Supported Go releases plus the version in the go.mod are tested. See:
# - https://github.com/actions/setup-go/tree/v5#getting-go-version-from-the-gomod-file
# - https://github.com/actions/setup-go/tree/v5#using-stableoldstable-aliases
go: ['go.mod', 'oldstable', 'stable']
steps:
- name: checkout source code
uses: actions/checkout@v4
- name: setup go environment
uses: actions/setup-go@v5
with:
go-version: ${{ matrix.go != 'go.mod' && matrix.go || null }}
go-version-file: ${{ matrix.go == 'go.mod' && 'go/src/github.com/opencontainers/image-spec/go.mod' || null }}
- name: create go.mod
run: |
# Fix for "cannot find main module" issue
go mod init github.com/opencontainers/runtime-spec
go get -d ./schema/...
- name: run golangci-lint
uses: golangci/golangci-lint-action@v8
with:
version: v2.5
- name: run tests
run: |
set -x
make install.tools
make .govet
make .gitvalidation
make docs
make -C schema test