Skip to content

Commit

Permalink
fix: use old make targets in gha
Browse files Browse the repository at this point in the history
  • Loading branch information
faiq committed Jan 11, 2024
1 parent c926fe1 commit e55f9ae
Show file tree
Hide file tree
Showing 5 changed files with 74 additions and 12 deletions.
14 changes: 10 additions & 4 deletions .github/workflows/build-dev.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,17 @@ jobs:
with:
enable-cache: true

- name: Run build
run: devbox run -- make build-snapshot
- name: Verify that generated manifests committed to the repository are up to date
run: devbox run -- make verify-manifests

- name: Build
run: devbox run -- make generate fmt vet build

- name: Run unit tests
run: devbox run -- make test
run: devbox run -- make unit-test

- name: Run coverage report
run: devbox run -- make coverage

- name: Publish Test Results
uses: EnricoMi/publish-unit-test-result-action@v2
Expand All @@ -54,8 +60,8 @@ jobs:
uses: codecov/codecov-action@v3
if: ${{ github.owner == 'nutanix-cloud-native' }}
with:
file: coverage.xml
fail_ci_if_error: true
file: coverage.out

- name: Run Trivy vulnerability scanner
uses: aquasecurity/trivy-action@0.16.1
Expand Down
66 changes: 61 additions & 5 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,67 @@ jobs:
password: ${{ secrets.GITHUB_TOKEN }}

- name: Release
id: meta
uses: docker/metadata-action@v5
with:
images: capi-nutanix
sep-tags: ","
sep-labels: ","
tags: |
type=semver,pattern=v{{version}}
type=semver,pattern=v{{major}}.{{minor}}
type=semver,pattern=v{{major}}
type=sha
- name: Prepare build
run: devbox run -- make manifests generate

- name: Build container
env:
KO_DOCKER_REPO: ghcr.io/${{ github.repository }}/controller
TAGS: ${{ steps.meta.outputs.tags }}
LABELS: ${{ steps.meta.outputs.labels }}
PLATFORMS: linux/amd64,linux/arm64,linux/arm
run: |
PTAGS=`echo $TAGS | sed 's/capi-nutanix://g'`
export SOURCE_DATE_EPOCH=$(date +%s)
ko build --bare --image-label "$LABELS" -t "$PTAGS" --platform=$PLATFORMS .
- name: parse semver
id: semver
env:
SEMVER: ${{ steps.meta.outputs.version }}
run: |
devbox run -- bash -ec "cd config/manager && kustomize edit set image controller=${KO_DOCKER_REPO}:${{ github.ref_name }}"
n=${SEMVER//[!0-9]/ }
a=(${n//\./ })
echo "::set-output name=major::${a[0]}"
echo "::set-output name=minor::${a[1]}"
- name: build template
env:
NEW_IMG: ghcr.io/${{ github.repository }}/controller:${{ steps.meta.outputs.version }}
run: |
(cd config/manager && kustomize edit set image controller=$NEW_IMG)
devbox run -- make release-manifests
git checkout config/manager/kustomization.yaml
devbox run -- make release
- name: generate image info
env:
KO_DOCKER_REPO: ghcr.io/${{ github.repository }}/controller
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NEW_IMG: ghcr.io/${{ github.repository }}/controller:${{ steps.meta.outputs.version }}
run: |
echo "## Images" >> ${{ github.workspace }}-CHANGELOG.txt
echo "|Name|Link|" >> ${{ github.workspace }}-CHANGELOG.txt
echo "|-|-|" >> ${{ github.workspace }}-CHANGELOG.txt
echo "|CAPX|[$NEW_IMG](https://$NEW_IMG)|" >> ${{ github.workspace }}-CHANGELOG.txt
- name: create release
uses: softprops/action-gh-release@v1
with:
draft: false
prerelease: false
body_path: ${{ github.workspace }}-CHANGELOG.txt
generate_release_notes: true
append_body: true
files: |
out/infrastructure-components.yaml
out/metadata.yaml
out/cluster-template*.yaml
2 changes: 1 addition & 1 deletion .github/workflows/synopsys-schedule.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
enable-cache: true

- name: Build Project
run: make build-snapshot
run: devbox run -- make build

- name: Run Synopsys Detect
uses: synopsys-sig/detect-action@v0.3.4
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/synopsys.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
enable-cache: true

- name: Build Project
run: make build-snapshot
run: devbox run -- make build

- name: Run Synopsys Detect
uses: synopsys-sig/detect-action@v0.3.4
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/trivy-scan.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
enable-cache: true

- name: Prepare build
run: make go-generate
run: devbox run -- make manifests generate

- name: Build container
env:
Expand Down

0 comments on commit e55f9ae

Please sign in to comment.