Skip to content

Commit

Permalink
NETOBSERV-757 update deprecated github actions, use go1.19 (#371)
Browse files Browse the repository at this point in the history
  • Loading branch information
jotak authored Jan 30, 2023
1 parent 3633f12 commit bb314ac
Show file tree
Hide file tree
Showing 7 changed files with 24 additions and 32 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/pull_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/pull_request_e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
11 changes: 3 additions & 8 deletions .github/workflows/push_image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}"
14 changes: 7 additions & 7 deletions .github/workflows/push_image_pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -34,17 +34,17 @@ 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: |
github.rest.issues.createComment({
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.'
})
13 changes: 5 additions & 8 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,26 +15,25 @@ 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
fi
- 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
Expand All @@ -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
2 changes: 1 addition & 1 deletion .github/workflows/update_location_db.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion contrib/docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -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
Expand Down

0 comments on commit bb314ac

Please sign in to comment.