Skip to content

run codegen before build #81

run codegen before build

run codegen before build #81

Workflow file for this run

name: Push to Main
on:
workflow_dispatch:
push:
branches: [main]
jobs:
prerelease:
strategy:
fail-fast: false
matrix:
terraform-version:
- "1.2"
- "1.3"
- "1.4"
- "1.5"
- "1.6"
- "latest"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: hashicorp/setup-terraform@v1
with:
terraform_version: ${{ matrix.terraform-version }}
- uses: actions/setup-node@v4
with:
node-version: "18"
cache: "yarn"
registry-url: "https://registry.npmjs.org"
- uses: actions/cache@v2
with:
path: ./.terraform/providers
key: ${{ runner.os }}-${{ matrix.terraform-version }}-providers-${{ hashFiles('**/.terraform.lock.hcl') }}
restore-keys: |
${{ runner.os }}-${{ matrix.terraform-version }}-providers-
- run: terraform init
- run: terraform fmt -check -recursive -diff
- run: terraform validate
- run: |
curl -Lo ./terraform-docs.tar.gz https://github.com/terraform-docs/terraform-docs/releases/download/v0.14.1/terraform-docs-v0.14.1-$(uname)-amd64.tar.gz
tar -xzf terraform-docs.tar.gz
chmod +x terraform-docs
working-directory: .terraform
- run: ./.terraform/terraform-docs markdown . --output-file README.md
- if: ${{ matrix.terraform-version == '1.2' }}
uses: scaffoldly/bump-version-action@v1
with:
action: prerelease
version-file: package.json
repo-token: ${{ secrets.GITHUB_TOKEN }}
- run: jq -r '.version' package.json | xargs -I {} sed -i 's/@latest/@{}/g' cdktf.json
- run: yarn
- uses: nick-fields/retry@v2
with:
timeout_minutes: 10
max_attempts: 10
command: yarn codegen
- run: yarn build