Skip to content

Updated dependencies and go version #50

Updated dependencies and go version

Updated dependencies and go version #50

Workflow file for this run

name: CI
on:
push:
branches:
- main
tags:
- "v*.*.*"
pull_request:
branches:
- main
paths-ignore:
- '**.md'
- '.gitignore'
workflow_dispatch:
permissions:
contents: write
env:
REGISTRY: 018471812555.dkr.ecr.eu-west-1.amazonaws.com
AWS_REGION: eu-west-1
jobs:
test:
name: Test
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup Go
uses: actions/setup-go@v4
with:
go-version: '1.21'
- run: go version
- name: Get Go Paths
id: go-paths
run: |
echo ::set-output name=mod_cache::$(go env GOMODCACHE)
echo ::set-output name=build_cache::$(go env GOCACHE)
- name: Go modules and build cache
uses: actions/cache@v3
with:
path: |
${{ steps.go-paths.outputs.mod_cache }}
${{ steps.go-paths.outputs.build_cache }}
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: Go modules sync
run: go mod tidy
- name: Run Tests
run: make test
release:
name: Build Push Release
if: startsWith( github.ref, 'refs/tags/' )
runs-on: ubuntu-latest
needs: test
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v2
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: ${{ env.AWS_REGION }}
- name: Login to Amazon ECR
id: login-ecr
uses: aws-actions/amazon-ecr-login@v1
- name: Setup Go
uses: actions/setup-go@v4
with:
go-version: '1.20'
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Get the version
id: get-version
run: |
VERSION=${GITHUB_REF#refs/tags/v}
TAG_NAME=${GITHUB_REF#refs/tags/}
echo "Building version $VERSION and tag $TAG_NAME"
if [[ -z "${VERSION}" ]] || [[ -z "${TAG_NAME}" ]]; then
echo "Invalid version or tag_name. version: $VERSION, tag_name: $TAG_NAME"
exit 1
fi
echo "VERSION=$VERSION" >> $GITHUB_ENV
echo "TAG_NAME=$TAG_NAME" >> $GITHUB_ENV
- name: Create Release YAML (gatling-operator.yaml)
env:
VERSION: ${{ env.VERSION }}
run: make manifests-release IMG=$REGISTRY/gatling-operator:$VERSION
- name: Build and push operator image ${{ env.VERSION }}
uses: docker/build-push-action@v3
with:
platforms: linux/amd64
tags: ${{ env.REGISTRY }}/gatling-operator:${{ env.VERSION }}
build-args: |
VERSION=${{ env.VERSION }}
push: true
- name: Build and push gatling-runner ${{ env.VERSION }}
uses: docker/build-push-action@v3
with:
platforms: linux/amd64
tags: ${{ env.REGISTRY }}/gatling:${{ env.VERSION }}
context: gatling
build-args: |
VERSION=${{ env.VERSION }}
push: true
- name: Create Release
uses: softprops/action-gh-release@v1
with:
name: ${{ env.TAG_NAME }}
draft: false
prerelease: false
generate_release_notes: true
files: gatling-operator.yaml