Skip to content

Commit

Permalink
ci: update workflows and machinery for go1.18
Browse files Browse the repository at this point in the history
Signed-off-by: Hank Donnay <hdonnay@redhat.com>
  • Loading branch information
hdonnay committed Mar 17, 2022
1 parent c7075aa commit 4180d78
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 9 deletions.
2 changes: 1 addition & 1 deletion .github/script/nightly-module.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/sh
set -e
: ${CLAIRCORE_BRANCH:=main}
: ${GO_VERSION:=1.17}
: ${GO_VERSION:=1.18}
test "${#GO_VERSION}" -gt 4 && GO_VERSION=${GO_VERSION%.*}

cd $(git rev-parse --show-toplevel)
Expand Down
17 changes: 14 additions & 3 deletions .github/workflows/config-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,16 @@ on:
- release-4.*

jobs:
commit-check:
config:
runs-on: ubuntu-latest
outputs:
go_versions: ${{ steps.config.outputs.go_versions }}
steps:
- id: config
run: |
echo '::set-output name=go_versions::["1.17", "1.18"]'
commit-check:
name: Commit Check
runs-on: ubuntu-latest
steps:
Expand All @@ -33,10 +42,11 @@ jobs:
accessToken: ${{ secrets.GITHUB_TOKEN }}
tidy:
name: Tidy
needs: ['config']
runs-on: ubuntu-latest
strategy:
matrix:
go: ['1.16']
go: ${{ fromJSON(needs.config.outputs.go_versions)[0] }}
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v2
Expand All @@ -48,10 +58,11 @@ jobs:
dir: ./config
test:
name: Test
needs: ['config']
runs-on: ubuntu-latest
strategy:
matrix:
go: ['1.16', '1.17']
go: ${{ fromJSON(needs.config.outputs.go_versions) }}
steps:
- uses: actions/setup-go@v2
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/cut-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
runs-on: 'ubuntu-latest'
strategy:
matrix:
image: ['quay.io/projectquay/golang:1.17']
image: ['quay.io/projectquay/golang:1.18']
container:
image: ${{ matrix.image }}
outputs:
Expand Down
15 changes: 13 additions & 2 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,15 @@ on:
- release-4.*

jobs:
config:
runs-on: ubuntu-latest
outputs:
go_versions: ${{ steps.config.outputs.go_versions }}
steps:
- id: config
run: |
echo '::set-output name=go_versions::["1.17", "1.18"]'
commit-check:
name: Commit Check
runs-on: ubuntu-latest
Expand Down Expand Up @@ -43,10 +52,11 @@ jobs:
tidy:
name: Tidy
needs: ['config']
runs-on: ubuntu-latest
strategy:
matrix:
go: ['1.16']
go: ${{ fromJSON(needs.config.outputs.go_versions)[0] }}
steps:
- uses: actions/setup-go@v2
with:
Expand All @@ -67,6 +77,7 @@ jobs:

tests:
name: Tests
needs: ['config']
runs-on: ubuntu-latest
container: quay.io/projectquay/golang:${{ matrix.go }}
env:
Expand Down Expand Up @@ -94,7 +105,7 @@ jobs:

strategy:
matrix:
go: ['1.16', '1.17']
go: ${{ fromJSON(needs.config.outputs.go_versions) }}
steps:
- uses: actions/checkout@v3
- uses: ./.github/actions/go-cache
Expand Down
5 changes: 3 additions & 2 deletions .github/workflows/nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
# nicer workflow inputs so that the cron trigger works.
run: |
br=$(test -n "${{github.event.inputs.branch}}" && echo "${{github.event.inputs.branch}}" || echo main)
gv=$(test -n "${{github.event.inputs.go_version}}" && echo "${{github.event.inputs.go_version}}" || echo 1.17.1)
gv=$(test -n "${{github.event.inputs.go_version}}" && echo "${{github.event.inputs.go_version}}" || echo 1.18)
: "${repo:=$GITHUB_REPOSITORY}"
test "${repo%%/*}" = quay && repo="projectquay/${repo##*/}" ||:
printf '::set-output name=push::%s\n' "${{ env.QUAY_TOKEN != '' }}"
Expand All @@ -42,7 +42,7 @@ jobs:
printf '::set-output name=repo::%s\n' "${repo}"
# Environment variables
printf 'CLAIRCORE_BRANCH=%s\n' "${br}" >> $GITHUB_ENV
printf 'GO_VERSION=%s\n' "$(test "${#gv}" -gt 4 && echo "${gv%.*}" || echo "${gv}")" >> $GITHUB_ENV
printf 'GO_VERSION=%s\n' "$gv" >> $GITHUB_ENV
printf '%s/.local/go/bin\n' "$HOME" >> $GITHUB_PATH
- uses: docker/setup-qemu-action@v1
with:
Expand All @@ -51,6 +51,7 @@ jobs:
- uses: actions/setup-go@v2
with:
go-version: ${{ steps.setup.outputs.go_version }}
check-latest: true
- uses: actions/checkout@v3
with:
fetch-depth: 0
Expand Down

0 comments on commit 4180d78

Please sign in to comment.