-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
aaf41a0
commit 3d0cfc3
Showing
3 changed files
with
29 additions
and
7 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,3 @@ | ||
# This workflow will build a golang project | ||
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-go | ||
|
||
name: Go | ||
|
||
on: | ||
|
@@ -9,13 +6,26 @@ on: | |
pull_request: | ||
branches: [ "main" ] | ||
|
||
|
||
jobs: | ||
|
||
build: | ||
runs-on: ubuntu-latest | ||
|
||
permissions: write-all | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
# Configure Workload Identity Federation via a credentials file. | ||
- id: 'auth' | ||
name: 'Authenticate to Google Cloud' | ||
uses: 'google-github-actions/auth@v1' | ||
with: | ||
workload_identity_provider: 'projects/536185737408/locations/global/workloadIdentityPools/carbonifer-gh-pool/providers/carbonifer-oidc-provider' | ||
service_account: '[email protected]' | ||
if: github.event_name != 'pull_request' | ||
|
||
- name: Set up Go | ||
uses: actions/setup-go@v3 | ||
with: | ||
|
@@ -37,5 +47,13 @@ jobs: | |
- name: golangci-lint | ||
uses: golangci/golangci-lint-action@v3 | ||
|
||
- name: Test | ||
run: go test -v ./... | ||
- name: Test with credentials | ||
run: go test -v ./... | ||
if: github.event_name != 'pull_request' | ||
|
||
# If run from fork, we should not use tests requiring credentials | ||
- name: Test without credentials | ||
run: go test -v ./... | ||
env: | ||
SKIP_WITH_CREDENTIALS: true | ||
if: github.event_name == 'pull_request' |
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