diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index e3d3167..5f917a5 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -8,13 +8,44 @@ on: jobs: build: - runs-on: ubuntu-latest + strategy: + fail-fast: true + matrix: + os: [ubuntu-latest] + go: [ + '1.18', + '1.19', + '1.20', + '1.21', + ] + include: + # Set the minimum Go patch version for the given Go minor + - go: '1.18' + GO_VERSION: '~1.18.0' + - go: '1.19' + GO_VERSION: '~1.19.0' + - go: '1.20' + GO_VERSION: '~1.20.0' + - go: '1.21' + GO_VERSION: '~1.21.0' + runs-on: ${{ matrix.os }} + steps: - - name: Set up Go 1.19 + - name: Set up Go ${{ matrix.go }} uses: actions/setup-go@v3 with: - go-version: 1.19 + go-version: ${{ matrix.GO_VERSION }} + check-latest: true + + - name: Print environment + id: vars + run: | + printf "Using Go at $(which go) (version $(go version))\n" + printf "\n\nGo environment:\n\n" + go env + printf "\n\nSystem environment:\n\n" + env - name: Check out the source code uses: actions/checkout@v3 @@ -23,9 +54,9 @@ jobs: uses: actions/cache@v3 with: path: ~/go/pkg/mod - key: go-${{ runner.os }}-${{ hashFiles('go.mod') }} + key: go-${{ runner.os }}-${{ matrix.go }}-${{ hashFiles('go.mod') }} restore-keys: | - go-${{ runner.os }}- + go-${{ runner.os }}-${{ matrix.go }} - name: Install Ragel 6.10 run: sudo apt-get install -y ragel