From ecbc1f85c5ada6c9e50a3f0b0724b8d7731349ba Mon Sep 17 00:00:00 2001 From: Francis Lavoie Date: Thu, 20 Aug 2020 22:40:26 -0400 Subject: ci: Tweaks for multi go version tests (#3673) --- .github/workflows/ci.yml | 14 +++++++------- .github/workflows/cross-build.yml | 14 +++++++++----- .github/workflows/fuzzing.yml | 6 +++--- .github/workflows/release.yml | 14 +++++++------- 4 files changed, 26 insertions(+), 22 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 08575c3..7233365 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -17,7 +17,7 @@ jobs: fail-fast: false matrix: os: [ ubuntu-latest, macos-latest, windows-latest ] - go-version: [ 1.14.x, 1.15.x ] + go: [ '1.14', '1.15' ] # Set some variables per OS, usable via ${{ matrix.VAR }} # CADDY_BIN_PATH: the path to the compiled Caddy binary, for artifact publishing @@ -41,7 +41,7 @@ jobs: - name: Install Go uses: actions/setup-go@v2 with: - go-version: ${{ matrix.go-version }} + go-version: ${{ matrix.go }} - name: Checkout code uses: actions/checkout@v2 @@ -69,12 +69,12 @@ jobs: echo "::set-output name=go_cache::$(go env GOCACHE)" - name: Cache the build cache - uses: actions/cache@v1 + uses: actions/cache@v2 with: path: ${{ steps.vars.outputs.go_cache }} - key: ${{ runner.os }}-go-ci-${{ hashFiles('**/go.sum') }} + key: ${{ runner.os }}-${{ matrix.go }}-go-ci-${{ hashFiles('**/go.sum') }} restore-keys: | - ${{ runner.os }}-go-ci + ${{ runner.os }}-${{ matrix.go }}-go-ci - name: Get dependencies run: | @@ -91,7 +91,7 @@ jobs: - name: Publish Build Artifact uses: actions/upload-artifact@v1 with: - name: caddy_v2_${{ runner.os }}_${{ steps.vars.outputs.short_sha }} + name: caddy_${{ runner.os }}_go${{ matrix.go }}_${{ steps.vars.outputs.short_sha }} path: ${{ matrix.CADDY_BIN_PATH }} # Commented bits below were useful to allow the job to continue @@ -167,7 +167,7 @@ jobs: steps: - name: checkout uses: actions/checkout@v2 - - uses: goreleaser/goreleaser-action@v1 + - uses: goreleaser/goreleaser-action@v2 with: version: latest args: check diff --git a/.github/workflows/cross-build.yml b/.github/workflows/cross-build.yml index 49abd79..f8ae5bb 100644 --- a/.github/workflows/cross-build.yml +++ b/.github/workflows/cross-build.yml @@ -14,14 +14,15 @@ jobs: fail-fast: false matrix: goos: ['android', 'linux', 'solaris', 'illumos', 'dragonfly', 'freebsd', 'openbsd', 'plan9', 'windows', 'darwin', 'netbsd'] - go-version: [ 1.14.x, 1.15.x ] + go: [ '1.14', '1.15' ] runs-on: ubuntu-latest continue-on-error: true steps: - name: Install Go uses: actions/setup-go@v2 with: - go-version: ${{ matrix.go-version }} + go-version: ${{ matrix.go }} + - name: Print Go version and environment id: vars run: | @@ -32,15 +33,18 @@ jobs: printf "\n\nSystem environment:\n\n" env echo "::set-output name=go_cache::$(go env GOCACHE)" + - name: Cache the build cache - uses: actions/cache@v1 + uses: actions/cache@v2 with: path: ${{ steps.vars.outputs.go_cache }} - key: cross-build-go-${{ matrix.goos }}-${{ hashFiles('**/go.sum') }} + key: cross-build-go${{ matrix.go }}-${{ matrix.goos }}-${{ hashFiles('**/go.sum') }} restore-keys: | - cross-build-go-${{ matrix.goos }} + cross-build-go${{ matrix.go }}-${{ matrix.goos }} + - name: Checkout code into the Go module directory uses: actions/checkout@v2 + - name: Run Build env: CGO_ENABLED: 0 diff --git a/.github/workflows/fuzzing.yml b/.github/workflows/fuzzing.yml index c3c9657..05f4629 100644 --- a/.github/workflows/fuzzing.yml +++ b/.github/workflows/fuzzing.yml @@ -12,14 +12,14 @@ jobs: strategy: matrix: os: [ ubuntu-latest ] - go-version: [ 1.14.x ] + go: [ '1.14' ] runs-on: ${{ matrix.os }} steps: - name: Install Go - uses: actions/setup-go@v1 + uses: actions/setup-go@v2 with: - go-version: ${{ matrix.go-version }} + go-version: ${{ matrix.go }} - name: Checkout code uses: actions/checkout@v2 diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 02129ab..763c9e2 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -11,14 +11,14 @@ jobs: strategy: matrix: os: [ ubuntu-latest ] - go-version: [ 1.14.x ] + go: [ '1.15' ] runs-on: ${{ matrix.os }} steps: - name: Install Go - uses: actions/setup-go@v1 + uses: actions/setup-go@v2 with: - go-version: ${{ matrix.go-version }} + go-version: ${{ matrix.go }} - name: Checkout code uses: actions/checkout@v2 @@ -54,16 +54,16 @@ jobs: echo "::set-output name=tag_special::${TAG_SPECIAL}" - name: Cache the build cache - uses: actions/cache@v1 + uses: actions/cache@v2 with: path: ${{ steps.vars.outputs.go_cache }} - key: ${{ runner.os }}-go-release-${{ hashFiles('**/go.sum') }} + key: ${{ runner.os }}-go${{ matrix.go }}-release-${{ hashFiles('**/go.sum') }} restore-keys: | - ${{ runner.os }}-go-release + ${{ runner.os }}-go${{ matrix.go }}-release # GoReleaser will take care of publishing those artifacts into the release - name: Run GoReleaser - uses: goreleaser/goreleaser-action@v1 + uses: goreleaser/goreleaser-action@v2 with: version: latest args: release --rm-dist -- cgit v1.2.3