Skip to content

feat(controllers): Implement the TerraformRun controller #785

feat(controllers): Implement the TerraformRun controller

feat(controllers): Implement the TerraformRun controller #785

Workflow file for this run

name: Continuous Integration
on:
push:
branches:
- main
tags:
- v*
pull_request:
branches:
- main
jobs:
unit-tests:
name: Unit Tests
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Cache envtest binaries
uses: actions/cache@v3
with:
path: ./bin/
key: binaries
- name: Setup Golang
uses: actions/setup-go@v4
with:
go-version: "1.19"
- name: Install envtest
run: make envtest
- name: Setup envtest
run: ./bin/setup-envtest use
- name: Run tests
run: make test
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v3
check-codegen:
name: Check Codegen
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup Golang
uses: actions/setup-go@v4
with:
go-version: "1.19"
- name: Generate manifests
run: make manifests
- name: Check nothing has changed
run: |
git diff --exit-code ./manifests
build-and-push:
name: Build & Push
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login to GHCR
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Get Build timestamp and branch name
run: |
echo "BUILD_TIMESTAMP=$(date +'%s')" >> $GITHUB_ENV
echo "VERSION=$( echo ${{ github.head_ref || github.ref_name }} | tr '/' '-' )" >> $GITHUB_ENV
- name: Build and push
uses: docker/build-push-action@v4
with:
push: true
build-args: |
VERSION=${{ env.VERSION }}
BUILD_TIMESTAMP=${{ env.BUILD_TIMESTAMP }}
COMMIT_HASH=${{ github.sha }}
tags: |
ghcr.io/${{ github.repository }}:${{ env.VERSION }}
ghcr.io/${{ github.repository }}:${{ github.sha }}