ci: add semgrep workflow #470
Workflow file for this run
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
name: Terraform E2E Test | |
on: | |
workflow_dispatch: | |
pull_request: | |
branches: [main] | |
workflow_run: | |
workflows: ["Dependabot PR Check"] | |
types: | |
- completed | |
permissions: | |
contents: none | |
jobs: | |
build_for_terratest: | |
runs-on: ubuntu-latest | |
if: ${{ github.event.workflow_run.conclusion == 'success' || (github.event_name == 'pull_request' && github.actor != 'dependabot[bot]') || github.event_name == 'workflow_dispatch' }} | |
permissions: | |
contents: read | |
steps: | |
- name: "Checkout" | |
uses: actions/checkout@v4 | |
with: | |
ref: ${{ github.event.workflow_run.conclusion == 'success' && github.event.workflow_run.head_branch || '' }} | |
- name: "Configure Go" | |
uses: actions/setup-go@v5 | |
- name: Install GoReleaser | |
uses: goreleaser/goreleaser-action@286f3b13b1b49da4ac219696163fb8c1c93e1200 | |
with: | |
install-only: true | |
- name: "Build" | |
run: make testrelease | |
- name: "Tar files" | |
run: tar -cvf test-reg.tar ./test-reg | |
- name: "Save build for testing" | |
uses: actions/upload-artifact@v4.4.3 | |
with: | |
name: test-build | |
path: ./test-reg.tar | |
if-no-files-found: error | |
terratest_pra: | |
runs-on: ubuntu-latest | |
needs: [build_for_terratest] | |
environment: | |
name: terratest-pra | |
permissions: | |
contents: read | |
steps: | |
- name: "Checkout" | |
uses: actions/checkout@v4 | |
- name: "Configure Go" | |
uses: actions/setup-go@v5 | |
- name: "Download test release" | |
uses: actions/download-artifact@v4.1.8 | |
with: | |
name: test-build | |
- name: "Untar files" | |
run: tar -xvf test-reg.tar | |
- name: "Setup Terraform" | |
uses: autero1/action-terraform@v3.0.1 | |
with: | |
terraform-version: latest | |
- name: "Run Tests" | |
run: go test -v -timeout 10m $(go list ./... | grep /test | xargs) | |
env: | |
BT_API_HOST: ${{ secrets.BT_API_HOST }} | |
BT_CLIENT_ID: ${{ secrets.BT_CLIENT_ID }} | |
BT_CLIENT_SECRET: ${{ secrets.BT_CLIENT_SECRET }} | |
terratest_rs: | |
runs-on: ubuntu-latest | |
needs: [build_for_terratest] | |
environment: | |
name: terratest-rs | |
permissions: | |
contents: read | |
steps: | |
- name: "Checkout" | |
uses: actions/checkout@v4 | |
- name: "Configure Go" | |
uses: actions/setup-go@v5 | |
- name: "Download test release" | |
uses: actions/download-artifact@v4.1.8 | |
with: | |
name: test-build | |
- name: "Untar files" | |
run: tar -xvf test-reg.tar | |
- name: "Setup Terraform" | |
uses: autero1/action-terraform@v3.0.1 | |
with: | |
terraform-version: latest | |
- name: "Run Tests" | |
run: go test -v -timeout 10m $(go list ./... | grep /test | xargs) | |
env: | |
BT_API_HOST: ${{ secrets.BT_API_HOST }} | |
BT_CLIENT_ID: ${{ secrets.BT_CLIENT_ID }} | |
BT_CLIENT_SECRET: ${{ secrets.BT_CLIENT_SECRET }} |