Skip to content

Add GitHub Actions reusable action for Vera (Issue #20)#32

Open
ZhuochengHe wants to merge 16 commits intoproject-vera:mainfrom
ZhuochengHe:feat/github_action_integration
Open

Add GitHub Actions reusable action for Vera (Issue #20)#32
ZhuochengHe wants to merge 16 commits intoproject-vera:mainfrom
ZhuochengHe:feat/github_action_integration

Conversation

@ZhuochengHe
Copy link
Copy Markdown
Contributor

@ZhuochengHe ZhuochengHe commented Mar 18, 2026

Summary

Adds GitHub Actions support for Vera (Issue #20). Three files under .github/:

  • actions/vera-setup/action.yml — reusable composite action for external projects. Pulls prebuilt emulator images from ghcr.io, starts them via docker run, polls for health, and writes all env vars (AWS_ENDPOINT_URL, CLOUDSDK_*, etc.) to $GITHUB_ENV so subsequent steps can use AWS CLI, gcloud, and Terraform without any extra configuration.

  • workflows/publish.yml — triggered on v* release tags. Builds vera-aws and vera-gcp Docker images in parallel (matrix strategy), pushes to ghcr.io with latest, full semver, and major.minor tags. Uses GHA build cache to avoid full rebuilds.

  • workflows/test-action.yml — manual-only (workflow_dispatch) integration test for the action itself. Runs two jobs: both emulators together, and AWS-only (start-gcp: false). Verifies env vars, AWS CLI, and gcloud CLI all work against the emulators.

Usage (external projects)

- uses: project-vera/vera/.github/actions/vera-setup@main
# AWS CLI, gcloud, Terraform all work in subsequent steps — no extra config needed

@ZhuochengHe
Copy link
Copy Markdown
Contributor Author

ZhuochengHe commented Mar 18, 2026

Related Issue: #20

- docker rm -f before docker run to handle retries/dirty runners
- Remove trailing / from CLOUDSDK_API_ENDPOINT_OVERRIDES_COMPUTE to
  avoid double-slash when user-supplied endpoint already ends with /
- Add cleanup step (if: always()) in test workflow to stop containers
  after each job, keeping runners clean
- Matrix strategy builds vera-aws and vera-gcp in parallel
- docker/metadata-action generates latest + sha + branch tags automatically
- Build cache (type=gha) avoids full rebuilds on unchanged layers
- Remove paths filter so main always builds (no silent misses)
type=gha cache requires the docker-container buildx driver.
docker/setup-buildx-action@v3 switches to it automatically.
Trigger on 'v*' tags only (e.g. v1.0.0) so images are published
at release time, not on every commit. Tags generated:
  - latest
  - v1.2.3  (full semver)
  - v1.2    (major.minor)
Documents vera-setup action usage for Terraform, AWS CLI, gcloud CLI,
and boto3, including env vars, options, and cleanup step.
@ZhuochengHe ZhuochengHe force-pushed the feat/github_action_integration branch from b143db2 to b8b7bd9 Compare March 20, 2026 00:16
@ZhuochengHe ZhuochengHe force-pushed the feat/github_action_integration branch from d06bee4 to 7afab12 Compare March 20, 2026 16:11
@ZhuochengHe
Copy link
Copy Markdown
Contributor Author

See TODO in action.yml. The current working repo is my forked repo.

CLOUDSDK_API_ENDPOINT_OVERRIDES_COMPUTE, CLOUDSDK_CORE_PROJECT, and
GOOGLE_OAUTH_ACCESS_TOKEN are already exported by vera-setup. Only
--access-token-file is needed to bypass gcloud credential checks.
@ZhuochengHe ZhuochengHe force-pushed the feat/github_action_integration branch from 4a9e241 to fe7475f Compare March 20, 2026 16:34
@zyang37 zyang37 self-requested a review March 23, 2026 15:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant