From bb314acf95258b91b71765de39e68e4c29af5d60 Mon Sep 17 00:00:00 2001 From: Joel Takvorian Date: Mon, 30 Jan 2023 11:41:16 +0100 Subject: [PATCH] NETOBSERV-757 update deprecated github actions, use go1.19 (#371) --- .github/workflows/pull_request.yml | 8 ++++---- .github/workflows/pull_request_e2e.yml | 6 +++--- .github/workflows/push_image.yml | 11 +++-------- .github/workflows/push_image_pr.yml | 14 +++++++------- .github/workflows/release.yml | 13 +++++-------- .github/workflows/update_location_db.yml | 2 +- contrib/docker/Dockerfile | 2 +- 7 files changed, 24 insertions(+), 32 deletions(-) diff --git a/.github/workflows/pull_request.yml b/.github/workflows/pull_request.yml index fb196002c..8bb640d55 100644 --- a/.github/workflows/pull_request.yml +++ b/.github/workflows/pull_request.yml @@ -12,23 +12,23 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - go: ['1.18'] + go: ['1.19'] steps: - name: install make run: sudo apt-get install make - name: set up go 1.x - uses: actions/setup-go@v2 + uses: actions/setup-go@v3 with: go-version: ${{ matrix.go }} - name: checkout - uses: actions/checkout@v2 + uses: actions/checkout@v3 - name: run build run: make build - name: run unit tests run: make tests-unit - name: upload coverage to codecov.io - uses: codecov/codecov-action@v2 + uses: codecov/codecov-action@v3 with: files: /tmp/coverage.out token: ${{ secrets.CODECOV_SECRET }} diff --git a/.github/workflows/pull_request_e2e.yml b/.github/workflows/pull_request_e2e.yml index c2e9730fe..93c57ac4f 100644 --- a/.github/workflows/pull_request_e2e.yml +++ b/.github/workflows/pull_request_e2e.yml @@ -12,17 +12,17 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - go: ['1.18'] + go: ['1.19'] steps: - name: install make run: sudo apt-get install make - name: set up go 1.x - uses: actions/setup-go@v2 + uses: actions/setup-go@v3 with: go-version: ${{ matrix.go }} - name: checkout - uses: actions/checkout@v2 + uses: actions/checkout@v3 - name: run build run: make build - name: run end-to-end tests diff --git a/.github/workflows/push_image.yml b/.github/workflows/push_image.yml index 0bc9a3b64..735fd1b1f 100644 --- a/.github/workflows/push_image.yml +++ b/.github/workflows/push_image.yml @@ -16,26 +16,21 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - go: ['1.18'] + go: ['1.19'] steps: - name: install make run: sudo apt-get install make - name: set up go 1.x - uses: actions/setup-go@v2 + uses: actions/setup-go@v3 with: go-version: ${{ matrix.go }} - name: checkout - uses: actions/checkout@v2 + uses: actions/checkout@v3 - name: docker login to quay.io uses: docker/login-action@v2 with: username: ${{ env.REGISTRY_USER }} password: ${{ env.REGISTRY_PASSWORD }} registry: quay.io - - name: get short sha - id: shortsha - run: echo "::set-output name=short_sha::$(git rev-parse --short HEAD)" - name: build and push images run: OCI_RUNTIME=docker DOCKER_TAG=${{ env.TAG }} make push-ci-images - - name: print image url - run: echo "Image pushed to ${{ steps.push-to-quay.outputs.registry-paths }}" diff --git a/.github/workflows/push_image_pr.yml b/.github/workflows/push_image_pr.yml index 280a01077..7c1f047a8 100644 --- a/.github/workflows/push_image_pr.yml +++ b/.github/workflows/push_image_pr.yml @@ -15,16 +15,16 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - go: ['1.18'] + go: ['1.19'] steps: - name: install make run: sudo apt-get install make - name: set up go 1.x - uses: actions/setup-go@v2 + uses: actions/setup-go@v3 with: go-version: ${{ matrix.go }} - name: checkout - uses: actions/checkout@v2 + uses: actions/checkout@v3 with: ref: "refs/pull/${{ github.event.number }}/merge" - name: docker login to quay.io @@ -34,11 +34,11 @@ jobs: password: ${{ secrets.QUAY_SECRET }} registry: quay.io - name: get short sha - id: shortsha - run: echo "::set-output name=short_sha::$(git rev-parse --short HEAD)" + run: echo "short_sha=$(git rev-parse --short HEAD)" >> $GITHUB_ENV + - name: build and push images run: OCI_RUNTIME=docker DOCKER_TAG=temp make push-ci-images - - uses: actions/github-script@v5 + - uses: actions/github-script@v6 with: github-token: ${{secrets.GITHUB_TOKEN}} script: | @@ -46,5 +46,5 @@ jobs: issue_number: context.issue.number, owner: context.repo.owner, repo: context.repo.repo, - body: 'New image: ${{ steps.push-to-quay.outputs.registry-paths }}. It will expire after two weeks.' + body: 'New image: ${{ env.REGISTRY }}/${{ env.IMAGE }}:${{ env.short_sha }}. It will expire after two weeks.' }) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index c4b41ffc8..a53842870 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -15,18 +15,17 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - go: ['1.18'] + go: ['1.19'] steps: - name: checkout - uses: actions/checkout@v2 + uses: actions/checkout@v3 - name: validate tag - id: validate_tag run: | tag=`git describe --exact-match --tags 2> /dev/null` if [[ $tag =~ ^v[0-9]+\.[0-9]+\.[0-9]+(-rc[0-9]+)?$ ]]; then echo "$tag is a valid release tag" set -e - echo "::set-output name=tag::$tag" + echo "tag=$tag" >> $GITHUB_ENV else echo "$tag is NOT a valid release tag" exit 1 @@ -34,7 +33,7 @@ jobs: - name: install make run: sudo apt-get install make - name: set up go 1.x - uses: actions/setup-go@v2 + uses: actions/setup-go@v3 with: go-version: ${{ matrix.go }} - name: docker login to quay.io @@ -44,6 +43,4 @@ jobs: password: ${{ env.REGISTRY_PASSWORD }} registry: quay.io - name: build and push images - run: OCI_RUNTIME=docker DOCKER_TAG=${{ steps.validate_tag.outputs.tag }} make push-multiarch-manifest - - name: print image url - run: echo "Image pushed to ${{ steps.push-to-quay.outputs.registry-paths }}" + run: OCI_RUNTIME=docker DOCKER_TAG=${{ env.tag }} make push-multiarch-manifest diff --git a/.github/workflows/update_location_db.yml b/.github/workflows/update_location_db.yml index b8018428f..b99a002f9 100644 --- a/.github/workflows/update_location_db.yml +++ b/.github/workflows/update_location_db.yml @@ -13,7 +13,7 @@ jobs: runs-on: ubuntu-latest steps: - name: checkout - uses: actions/checkout@v2 + uses: actions/checkout@v3 with: persist-credentials: false fetch-depth: 0 diff --git a/contrib/docker/Dockerfile b/contrib/docker/Dockerfile index 04470fc36..cd361c5f9 100644 --- a/contrib/docker/Dockerfile +++ b/contrib/docker/Dockerfile @@ -1,7 +1,7 @@ # We do not use --platform feature to auto fill this ARG because of incompatibility between podman and docker ARG TARGETPLATFORM=linux/amd64 ARG BUILDPLATFORM=linux/amd64 -FROM --platform=$BUILDPLATFORM docker.io/library/golang:1.18 as builder +FROM --platform=$BUILDPLATFORM docker.io/library/golang:1.19 as builder ARG TARGETPLATFORM ARG TARGETARCH=amd64