Merge pull request #239 from hwakabh/docs/fix_code_highlights #718
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 GitHub action runs acceptance tests every night. | |
# | |
name: "Acceptance Test" | |
on: | |
push: | |
branches: | |
- "main" | |
permissions: | |
contents: read | |
jobs: | |
get-go-version: | |
runs-on: ubuntu-latest | |
outputs: | |
go-version: ${{ steps.get-go-version.outputs.go-version }} | |
steps: | |
- uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4 | |
- name: 'Determine Go version' | |
id: get-go-version | |
# We use .go-version as our source of truth for current Go | |
# version, because "goenv" can react to it automatically. | |
run: | | |
echo "Building with Go $(cat .go-version)" | |
echo "go-version=$(cat .go-version)" >>"$GITHUB_OUTPUT" | |
acceptance-test: | |
runs-on: ubuntu-latest | |
name: Acceptance Test | |
needs: get-go-version | |
steps: | |
- uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4 | |
- uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 # v5.0.0 | |
with: | |
go-version: ${{ needs.get-go-version.outputs.go-version }} | |
- name: Install gotestsum | |
run: go install gotest.tools/gotestsum@latest | |
- name: Set up Cloud SDK | |
uses: google-github-actions/setup-gcloud@98ddc00a17442e89a24bbf282954a3b65ce6d200 # v2.1.0 | |
- name: Install Packer | |
uses: hashicorp/setup-packer@ae6b3ed3bec089bbfb576ab7d714df7cbc4b88a4 # v2.0.0 | |
with: | |
version: latest | |
- name: 'Authenticate to Google Cloud' | |
uses: google-github-actions/auth@55bd3a7c6e2ae7cf1877fd1ccb9d54c0503c457c # v2.1.2 | |
id: 'gcp-auth' | |
with: | |
credentials_json: '${{ secrets.GOOGLE_CREDENTIALS }}' | |
access_token_lifetime: '7200s' | |
export_environment_variables: false | |
create_credentials_file: true | |
cleanup_credentials: true | |
- name: Run Acceptance Tests | |
run: | | |
mkdir -p /tmp/test-results | |
make dev | |
PACKER_ACC=1 gotestsum --format=short-verbose -- -count=1 -timeout=120m -p 2 ./... | |
env: | |
GOOGLE_APPLICATION_CREDENTIALS: ${{ steps.gcp-auth.outputs.credentials_file_path }} | |
GOOGLE_PROJECT_ID: ${{ secrets.GOOGLE_PROJECT_ID }} |