Skip to content

Updated template lifecycle statement #13

Updated template lifecycle statement

Updated template lifecycle statement #13

name: Build and Test in Development phase
on:
push:
branches-ignore:
- main
jobs:
build:
name: Build & push image
runs-on: ubuntu-latest
steps:
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: 1.19
- name: Check out code
uses: actions/checkout@v1
- name: Login to Github Packages
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Create k8s Kind Cluster for Unit Tests
uses: helm/[email protected]
- name: Create Secret
run: |
kubectl create secret generic regcred --from-file=.dockerconfigjson=${HOME}/.docker/config.json --type=kubernetes.io/dockerconfigjson
- name: Unit Test and Coverage Report.
run: |
mkdir -p reports
make test-coverage
- name: Upload Test coverage Reports
if: ${{ always() }}
uses: actions/upload-artifact@v2
with:
name: code-coverage-report
path: |
./reports/cover.out
./reports/cover.html
- name: Go Coverage Badge
uses: tj-actions/coverage-badge-go@v2
with:
filename: ./reports/coverage.out
- name: Verify Changed files
uses: tj-actions/verify-changed-files@v12
id: verify-changed-files
with:
files: README.md
- name: Commit changes
if: steps.verify-changed-files.outputs.files_changed == 'true'
run: |
git config --local user.email "[email protected]"
git config --local user.name "GitHub Action"
git add README.md
git commit -m "chore: Updated coverage badge."
# - name: Push changes except for the release branch or main (which is protected)
# if: ${{ !startsWith(github.ref_name, 'v1.') && (github.ref_name != 'main') && (steps.verify-changed-files.outputs.files_changed == 'true') }}
# uses: ad-m/github-push-action@master
# with:
# github_token: ${{ github.token }}
# force: true
# branch: ${{ github.ref }}
- name: Lint and Build
run: |
go fmt ./... | wc -l | grep 0
make docker-build
- name: Build image and push GitHub Container Registry
run: make docker-push
int-minimal-non-ha:
# if: ${{ false }} # disable for now
needs: build
uses: ./.github/workflows/test-minimal-params.yml
secrets: inherit
int-minimal-ha:
# if: ${{ false }} # disable for now
needs: build
uses: ./.github/workflows/test-minimal-params-ha.yml
secrets: inherit
int-full-non-ha:
# if: ${{ false }} # disable for now
needs: build
uses: ./.github/workflows/test-full-params.yml
secrets: inherit
int-full-ha:
# if: ${{ false }} # disable for now
needs: build
uses: ./.github/workflows/test-full-params-ha.yml
secrets: inherit
int-broker-version-update:
# if: ${{ false }} # disable for now
needs: build
uses: ./.github/workflows/test-broker-upgrade-update.yml
secrets: inherit
int-helm-to-operator-upgrade:
# if: ${{ false }} # disable for now
needs: build
uses: ./.github/workflows/test-helm-upgrade.yml
secrets: inherit
int-chaos-mesh:
# if: ${{ false }} # disable for now
needs: build
uses: ./.github/workflows/test-broker-chaos-situation.yml
secrets: inherit