Skip to content

Commit

Permalink
build: ensure compatibility for all supported Go versions
Browse files Browse the repository at this point in the history
Use matrix testing to test on currently supported Go versions,
including 1.19 pre-release.

The `go.mod` compatibility level is also set to 1.17. Once 1.19
is released, we should bump to 1.18, as Go always supports the
current version and one older, so we should stick with this as
well.

Signed-off-by: Milas Bowman <milas.bowman@docker.com>
  • Loading branch information
milas committed Jul 29, 2022
1 parent f1f5433 commit 81261dc
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 deletions.
16 changes: 11 additions & 5 deletions .github/workflows/ci.yml
@@ -1,13 +1,17 @@
on: [push, pull_request]
name: Continuous integration

permissions:
contents: read

jobs:
validate:
name: validate
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v3
- name: Lint code
uses: golangci/golangci-lint-action@v2
- name: Check license
Expand All @@ -16,16 +20,18 @@ jobs:
test:
strategy:
matrix:
go-version: [1.18.x]
go-version: ['1.17', '1.18', '>=1.19.0-rc.2']
platform: [ubuntu-latest, macos-latest, windows-latest]
runs-on: ${{ matrix.platform }}
timeout-minutes: 5
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Install Go
uses: actions/setup-go@v2
uses: actions/setup-go@v3
with:
go-version: ${{ matrix.go-version }}
- name: Checkout code
uses: actions/checkout@v2
check-latest: true
cache: true
- name: Test
run: go test ./...
2 changes: 1 addition & 1 deletion go.mod
@@ -1,6 +1,6 @@
module github.com/compose-spec/compose-go

go 1.18
go 1.17

require (
github.com/distribution/distribution/v3 v3.0.0-20220725133111-4bf3547399eb
Expand Down

0 comments on commit 81261dc

Please sign in to comment.