-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Alex Goodman <[email protected]>
- Loading branch information
Showing
8 changed files
with
115 additions
and
95 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,13 +10,14 @@ on: | |
|
||
env: | ||
GO_VERSION: "1.18.x" | ||
GO_CACHE_KEY: efa04b89c1b1 | ||
|
||
jobs: | ||
quality-gate: | ||
environment: release | ||
runs-on: ubuntu-latest # This OS choice is arbitrary. None of the steps in this job are specific to either Linux or macOS. | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions/checkout@v3 | ||
|
||
# we don't want to release commits that have been pushed and tagged, but not necessarily merged onto main | ||
- name: Ensure tagged commit is on main | ||
|
@@ -26,7 +27,7 @@ jobs: | |
git merge-base --is-ancestor ${GITHUB_REF##*/} origin/main && echo "${GITHUB_REF##*/} is a commit on main!" | ||
- name: Check static analysis results | ||
uses: fountainhead/action-wait-for-check@v1.0.0 | ||
uses: fountainhead/action-wait-for-check@v1.1.0 | ||
id: static-analysis | ||
with: | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
|
@@ -35,89 +36,52 @@ jobs: | |
ref: ${{ github.event.pull_request.head.sha || github.sha }} | ||
|
||
- name: Check unit test results | ||
uses: fountainhead/action-wait-for-check@v1.0.0 | ||
uses: fountainhead/action-wait-for-check@v1.1.0 | ||
id: unit | ||
with: | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
# This check name is defined as the github action job name (in .github/workflows/testing.yaml) | ||
checkName: "Unit tests" | ||
ref: ${{ github.event.pull_request.head.sha || github.sha }} | ||
|
||
- name: Check integration test results | ||
uses: fountainhead/[email protected] | ||
id: integration | ||
with: | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
# This check name is defined as the github action job name (in .github/workflows/testing.yaml) | ||
checkName: "Integration tests" | ||
ref: ${{ github.event.pull_request.head.sha || github.sha }} | ||
|
||
- name: Check acceptance test results (linux) | ||
uses: fountainhead/[email protected] | ||
id: acceptance-linux | ||
with: | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
# This check name is defined as the github action job name (in .github/workflows/testing.yaml) | ||
checkName: "Acceptance tests (Linux)" | ||
ref: ${{ github.event.pull_request.head.sha || github.sha }} | ||
|
||
- name: Check acceptance test results (mac) | ||
uses: fountainhead/[email protected] | ||
id: acceptance-mac | ||
with: | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
# This check name is defined as the github action job name (in .github/workflows/testing.yaml) | ||
checkName: "Acceptance tests (Mac)" | ||
ref: ${{ github.event.pull_request.head.sha || github.sha }} | ||
|
||
- name: Check cli test results (linux) | ||
uses: fountainhead/[email protected] | ||
id: cli-linux | ||
with: | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
# This check name is defined as the github action job name (in .github/workflows/testing.yaml) | ||
checkName: "CLI tests (Linux)" | ||
ref: ${{ github.event.pull_request.head.sha || github.sha }} | ||
|
||
- name: Quality gate | ||
if: steps.static-analysis.outputs.conclusion != 'success' || steps.unit.outputs.conclusion != 'success' || steps.integration.outputs.conclusion != 'success' || steps.cli-linux.outputs.conclusion != 'success' || steps.acceptance-linux.outputs.conclusion != 'success' || steps.acceptance-mac.outputs.conclusion != 'success' | ||
if: steps.static-analysis.outputs.conclusion != 'success' || steps.unit.outputs.conclusion != 'success' | ||
run: | | ||
echo "Static Analysis Status: ${{ steps.static-analysis.conclusion }}" | ||
echo "Unit Test Status: ${{ steps.unit.outputs.conclusion }}" | ||
echo "Integration Test Status: ${{ steps.integration.outputs.conclusion }}" | ||
echo "Acceptance Test (Linux) Status: ${{ steps.acceptance-linux.outputs.conclusion }}" | ||
echo "Acceptance Test (Mac) Status: ${{ steps.acceptance-mac.outputs.conclusion }}" | ||
echo "CLI Test (Linux) Status: ${{ steps.cli-linux.outputs.conclusion }}" | ||
false | ||
release: | ||
needs: [quality-gate] | ||
runs-on: ubuntu-latest | ||
permissions: | ||
packages: write | ||
contents: write | ||
steps: | ||
|
||
- uses: actions/setup-go@v2 | ||
- uses: actions/setup-go@v3 | ||
with: | ||
go-version: ${{ env.GO_VERSION }} | ||
|
||
- uses: actions/checkout@v2 | ||
- uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Restore tool cache | ||
id: tool-cache | ||
uses: actions/cache@v2.1.3 | ||
uses: actions/cache@v3 | ||
with: | ||
path: ${{ github.workspace }}/.tmp | ||
key: ${{ runner.os }}-tool-${{ hashFiles('Makefile') }} | ||
|
||
- name: Restore go cache | ||
id: go-cache | ||
uses: actions/cache@v2.1.3 | ||
uses: actions/cache@v3 | ||
with: | ||
path: ~/go/pkg/mod | ||
key: ${{ runner.os }}-go-${{ env.GO_VERSION }}-${{ hashFiles('**/go.sum') }} | ||
key: ${{ runner.os }}-go-${{ env.GO_VERSION }}-${{ env.GO_CACHE_KEY }}-${{ hashFiles('**/go.sum') }} | ||
restore-keys: | | ||
${{ runner.os }}-go-${{ env.GO_VERSION }}- | ||
${{ runner.os }}-go-${{ env.GO_VERSION }}-${{ env.GO_CACHE_KEY }}- | ||
- name: (cache-miss) Bootstrap all project dependencies | ||
if: steps.tool-cache.outputs.cache-hit != 'true' || steps.go-cache.outputs.cache-hit != 'true' | ||
|
@@ -126,15 +90,18 @@ jobs: | |
- name: Build & publish release artifacts | ||
run: make release | ||
env: | ||
DOCKER_USERNAME: ${{ secrets.TOOLBOX_DOCKER_USER }} | ||
DOCKER_PASSWORD: ${{ secrets.TOOLBOX_DOCKER_PASS }} | ||
GITHUB_TOKEN: ${{ secrets.ANCHORE_GIT_READ_TOKEN }} | ||
QUILL_SIGNING_P12: ${{ secrets.APPLE_SIGNING_P12 }} | ||
QUILL_SIGNING_PASSWORD: ${{ secrets.APPLE_SIGNING_P12_PASSWORD }} | ||
QUILL_NOTARY_ISSUER: ${{ secrets.APPLE_NOTARY_ISSUER }} | ||
QUILL_NOTARY_KEY_ID: ${{ secrets.APPLE_NOTARY_KEY_ID }} | ||
QUILL_NOTARY_KEY: ${{ secrets.APPLE_NOTARY_KEY }} | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- uses: anchore/sbom-action@v0 | ||
with: | ||
artifact-name: sbom.spdx.json | ||
|
||
- uses: actions/upload-artifact@v2 | ||
- uses: actions/upload-artifact@v3 | ||
with: | ||
name: artifacts | ||
path: dist/**/* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.