Skip to content

Commit

Permalink
Merge branch 'main' into moved-block
Browse files Browse the repository at this point in the history
  • Loading branch information
Maed223 committed Oct 5, 2023
2 parents 900e458 + e883479 commit cdb0f8f
Show file tree
Hide file tree
Showing 75 changed files with 2,896 additions and 240 deletions.
26 changes: 19 additions & 7 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,27 @@ jobs:
run: git config --global --add safe.directory /__w/terraform-cdk/terraform-cdk
- name: ensure correct user
run: chown -R root /__w/terraform-cdk
- name: Get yarn cache directory path
# Setup caches for yarn, and go
- name: Get cache directory paths
id: global-cache-dir-path
run: echo "dir=$(yarn cache dir)" >> $GITHUB_OUTPUT
run: |
echo "yarn=$(yarn cache dir)" >> $GITHUB_OUTPUT
mkdir -p /usr/local/share/.cache/go
echo "go=/usr/local/share/.cache/go" >> $GITHUB_OUTPUT
- uses: actions/cache@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8
with:
path: ${{ steps.global-cache-dir-path.outputs.yarn }}
key: yarn-${{ runner.os }}-${{ hashFiles('**/yarn.lock') }}-build
restore-keys: |
yarn-${{ runner.os }}-${{ hashFiles('**/yarn.lock') }}-
yarn-${{ runner.os }}-
- uses: actions/cache@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8
id: global-cache # use this to check for `cache-hit` (`steps.global-cache.outputs.cache-hit != 'true'`)
with:
path: ${{ steps.global-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
path: ${{ steps.global-cache-dir-path.outputs.go }}
key: go-${{ runner.os }}-${{ hashFiles('**/go.sum') }}-build
restore-keys: |
go-${{ runner.os }}-${{ hashFiles('**/go.sum') }}-
go-${{ runner.os }}-
- name: install dependencies
run: yarn install
- name: build and package
Expand All @@ -43,5 +56,4 @@ jobs:
yarn package
env:
SENTRY_DSN: ${{ secrets.SENTRY_DSN }}
TF_PLUGIN_CACHE_DIR: ${{ steps.global-cache-dir-path.outputs.dir }}/terraform-plugins
GOCACHE: ${{ steps.global-cache-dir-path.outputs.dir }}/go-cache
GOCACHE: ${{ steps.global-cache-dir-path.outputs.go }}
39 changes: 29 additions & 10 deletions .github/workflows/examples.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,16 +50,35 @@ jobs:
run: git config --global --add safe.directory /__w/terraform-cdk/terraform-cdk
- name: ensure correct user
run: chown -R root /__w/terraform-cdk
- name: Get yarn cache directory path
# Setup caches for yarn, terraform, and go
- name: Get cache directory paths
id: global-cache-dir-path
run: echo "dir=$(yarn cache dir)" >> $GITHUB_OUTPUT
run: |
echo "yarn=$(yarn cache dir)" >> $GITHUB_OUTPUT
mkdir -p /usr/local/share/.cache/terraform
echo "terraform=/usr/local/share/.cache/terraform" >> $GITHUB_OUTPUT
mkdir -p /usr/local/share/.cache/go
echo "go=/usr/local/share/.cache/go" >> $GITHUB_OUTPUT
- uses: actions/cache@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8
with:
path: ${{ steps.global-cache-dir-path.outputs.yarn }}
key: yarn-${{ runner.os }}-${{ hashFiles('**/yarn.lock') }}-examples
restore-keys: |
yarn-${{ runner.os }}-${{ hashFiles('**/yarn.lock') }}-
yarn-${{ runner.os }}-
- uses: actions/cache@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8
with:
path: ${{ steps.global-cache-dir-path.outputs.terraform }}
key: terraform-${{ runner.os }}-${{ matrix.terraform }}-examples
restore-keys: |
terraform-${{ runner.os }}-${{ matrix.terraform }}
- uses: actions/cache@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8
id: global-cache # use this to check for `cache-hit` (`steps.global-cache.outputs.cache-hit != 'true'`)
with:
path: ${{ steps.global-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-examples-yarn-${{ hashFiles('**/yarn.lock') }}
path: ${{ steps.global-cache-dir-path.outputs.go }}
key: go-${{ runner.os }}-${{ hashFiles('**/go.sum') }}-examples
restore-keys: |
${{ runner.os }}-examples-yarn-
go-${{ runner.os }}-${{ hashFiles('**/go.sum') }}-
go-${{ runner.os }}-
- name: installing dependencies
run: |
yarn install --frozen-lockfile --prefer-offline
Expand All @@ -72,8 +91,8 @@ jobs:
run: yarn build
env:
TERRAFORM_BINARY_NAME: "terraform${{ matrix.terraform }}"
TF_PLUGIN_CACHE_DIR: ${{ steps.global-cache-dir-path.outputs.dir }}/terraform-plugins
GOCACHE: ${{ steps.global-cache-dir-path.outputs.dir }}/go-cache
TF_PLUGIN_CACHE_DIR: ${{ steps.global-cache-dir-path.outputs.terraform }}
GOCACHE: ${{ steps.global-cache-dir-path.outputs.go }}
- name: create bundle
run: yarn package
- name: examples integration tests
Expand All @@ -83,5 +102,5 @@ jobs:
TEST_TARGET: "${{ matrix.target }}"
TERRAFORM_BINARY_NAME: "terraform${{ matrix.terraform }}"
MAVEN_OPTS: "-Xmx3G"
TF_PLUGIN_CACHE_DIR: ${{ steps.global-cache-dir-path.outputs.dir }}/terraform-plugins
GOCACHE: ${{ steps.global-cache-dir-path.outputs.dir }}/go-cache
TF_PLUGIN_CACHE_DIR: ${{ steps.global-cache-dir-path.outputs.terraform }}
GOCACHE: ${{ steps.global-cache-dir-path.outputs.go }}
112 changes: 86 additions & 26 deletions .github/workflows/integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,18 +33,29 @@ jobs:
run: git config --global --add safe.directory /__w/terraform-cdk/terraform-cdk
- name: ensure correct user
run: chown -R root /__w/terraform-cdk
- name: Get yarn cache directory path
# Setup caches for yarn, and go
- name: Get cache directory paths
id: global-cache-dir-path
run: echo "dir=$(yarn cache dir)" >> $GITHUB_OUTPUT
run: |
echo "yarn=$(yarn cache dir)" >> $GITHUB_OUTPUT
mkdir -p /usr/local/share/.cache/go
echo "go=/usr/local/share/.cache/go" >> $GITHUB_OUTPUT
- uses: actions/cache@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8
with:
path: ${{ steps.global-cache-dir-path.outputs.yarn }}
key: yarn-${{ runner.os }}-${{ hashFiles('**/yarn.lock') }}-integration
restore-keys: |
yarn-${{ runner.os }}-${{ hashFiles('**/yarn.lock') }}-
yarn-${{ runner.os }}-
- uses: actions/cache@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8
id: global-cache # use this to check for `cache-hit` (`steps.global-cache.outputs.cache-hit != 'true'`)
with:
path: ${{ steps.global-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-integration-yarn-${{ hashFiles('**/yarn.lock') }}
path: ${{ steps.global-cache-dir-path.outputs.go }}
key: go-${{ runner.os }}-${{ hashFiles('**/go.sum') }}-integration
restore-keys: |
go-${{ runner.os }}-${{ hashFiles('**/go.sum') }}-
go-${{ runner.os }}-
- name: install dependencies
run: yarn install --frozen-lockfile --prefer-offline
env:
YARN_CACHE_FOLDER: ${{ steps.global-cache-dir-path.outputs.dir }}
- name: set version
if: ${{ !inputs.skip_setup }}
run: tools/align-version.sh "-dev.$GITHUB_RUN_ID"
Expand All @@ -55,8 +66,7 @@ jobs:
yarn package
env:
SENTRY_DSN: ${{ secrets.SENTRY_DSN }}
TF_PLUGIN_CACHE_DIR: ${{ steps.global-cache-dir-path.outputs.dir }}/terraform-plugins
GOCACHE: ${{ steps.global-cache-dir-path.outputs.dir }}/go-cache
GOCACHE: ${{ steps.global-cache-dir-path.outputs.go }}
- name: Upload dist
uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce
if: ${{ !inputs.skip_setup }}
Expand All @@ -72,8 +82,6 @@ jobs:
- name: installing test dependencies
run: |
cd test && yarn install --frozen-lockfile --prefer-offline
env:
YARN_CACHE_FOLDER: ${{ steps.global-cache-dir-path.outputs.dir }}
- id: build-test-matrix
run: |
./tools/build-test-matrix.sh
Expand All @@ -95,16 +103,42 @@ jobs:

steps:
- uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab
- name: Get yarn cache directory path
id: global-cache-dir-path
run: echo "dir=$(yarn cache dir)" >> $GITHUB_OUTPUT
- name: ensure correct user
run: chown -R root /__w/terraform-cdk
# Setup caches for yarn, terraform, and go
- name: Get cache directory paths
id: global-cache-dir-path
run: |
echo "yarn=$(yarn cache dir)" >> $GITHUB_OUTPUT
mkdir -p /usr/local/share/.cache/terraform
echo "terraform=/usr/local/share/.cache/terraform" >> $GITHUB_OUTPUT
mkdir -p /usr/local/share/.cache/go
echo "go=/usr/local/share/.cache/go" >> $GITHUB_OUTPUT
- uses: actions/cache@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8
id: global-cache # use this to check for `cache-hit` (`steps.global-cache.outputs.cache-hit != 'true'`)
with:
path: ${{ steps.global-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-integration-yarn-${{ hashFiles('**/yarn.lock') }}
path: ${{ steps.global-cache-dir-path.outputs.yarn }}
# put matrix before integration to not restore caches from other sibling matrix jobs
key: yarn-${{ runner.os }}-${{ hashFiles('**/yarn.lock') }}-matrix-integration-${{ matrix.target }}
restore-keys: |
yarn-${{ runner.os }}-${{ hashFiles('**/yarn.lock') }}-integration
yarn-${{ runner.os }}-${{ hashFiles('**/yarn.lock') }}-
yarn-${{ runner.os }}-
- uses: actions/cache@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8
with:
path: ${{ steps.global-cache-dir-path.outputs.terraform }}
# put matrix before integration to not restore caches from other sibling matrix jobs
key: terraform-${{ runner.os }}-${{ matrix.terraform }}-matrix-integration-${{ matrix.target }}
restore-keys: |
terraform-${{ runner.os }}-${{ matrix.terraform }}-
- uses: actions/cache@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8
with:
path: ${{ steps.global-cache-dir-path.outputs.go }}
# put matrix before integration to not restore caches from other sibling matrix jobs
key: go-${{ runner.os }}-${{ hashFiles('**/go.sum') }}-matrix-integration-${{ matrix.target }}
restore-keys: |
go-${{ runner.os }}-${{ hashFiles('**/go.sum') }}-integration
go-${{ runner.os }}-${{ hashFiles('**/go.sum') }}
go-${{ runner.os }}-
- name: Download dist
uses: actions/download-artifact@9bc31d5ccc31df68ecc42ccf4149144866c47d8a
with:
Expand All @@ -124,8 +158,8 @@ jobs:
TERRAFORM_CLOUD_TOKEN: ${{ secrets.TERRAFORM_CLOUD_TOKEN }}
TERRAFORM_BINARY_NAME: "terraform${{ matrix.terraform }}"
NODE_OPTIONS: "--max-old-space-size=7168"
TF_PLUGIN_CACHE_DIR: ${{ steps.global-cache-dir-path.outputs.dir }}/terraform-plugins
GOCACHE: ${{ steps.global-cache-dir-path.outputs.dir }}/go-cache
TF_PLUGIN_CACHE_DIR: ${{ steps.global-cache-dir-path.outputs.terraform }}
GOCACHE: ${{ steps.global-cache-dir-path.outputs.go }}

windows_integration:
needs: prepare-integration-tests
Expand All @@ -143,15 +177,41 @@ jobs:

steps:
- uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab
- name: Get yarn cache directory path
# Setup caches for yarn, terraform, and go
- name: Get cache directory paths
id: global-cache-dir-path
run: echo "dir=$(yarn cache dir)" >> $GITHUB_OUTPUT
shell: bash
run: |
echo "yarn=$(yarn cache dir)" >> $GITHUB_OUTPUT
mkdir -p /usr/local/share/.cache/terraform
echo "terraform=/usr/local/share/.cache/terraform" >> $GITHUB_OUTPUT
mkdir -p /usr/local/share/.cache/go
echo "go=/usr/local/share/.cache/go" >> $GITHUB_OUTPUT
- uses: actions/cache@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8
with:
path: ${{ steps.global-cache-dir-path.outputs.yarn }}
# put matrix before integration to not restore caches from other sibling matrix jobs
key: yarn-${{ runner.os }}-${{ hashFiles('**/yarn.lock') }}-matrix-integration-${{ matrix.target }}
restore-keys: |
yarn-${{ runner.os }}-${{ hashFiles('**/yarn.lock') }}-integration
yarn-${{ runner.os }}-${{ hashFiles('**/yarn.lock') }}-
yarn-${{ runner.os }}-
- uses: actions/cache@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8
with:
path: ${{ steps.global-cache-dir-path.outputs.terraform }}
# put matrix before integration to not restore caches from other sibling matrix jobs
key: terraform-${{ runner.os }}-${{ matrix.terraform }}-matrix-integration-${{ matrix.target }}
restore-keys: |
terraform-${{ runner.os }}-${{ matrix.terraform }}-
- uses: actions/cache@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8
id: global-cache # use this to check for `cache-hit` (`steps.global-cache.outputs.cache-hit != 'true'`)
with:
path: ${{ steps.global-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-integration-yarn-${{ hashFiles('**/yarn.lock') }}
path: ${{ steps.global-cache-dir-path.outputs.go }}
# put matrix before integration to not restore caches from other sibling matrix jobs
key: go-${{ runner.os }}-${{ hashFiles('**/go.sum') }}-matrix-integration-${{ matrix.target }}
restore-keys: |
go-${{ runner.os }}-${{ hashFiles('**/go.sum') }}-integration
go-${{ runner.os }}-${{ hashFiles('**/go.sum') }}-
go-${{ runner.os }}-
- name: HashiCorp - Setup Terraform
uses: hashicorp/setup-terraform@633666f66e0061ca3b725c73b2ec20cd13a8fdd1
with:
Expand Down Expand Up @@ -185,5 +245,5 @@ jobs:
TEST_TARGET: ${{ matrix.target }}
TERRAFORM_CLOUD_TOKEN: ${{ secrets.TERRAFORM_CLOUD_TOKEN }}
NODE_OPTIONS: "--max-old-space-size=7168"
TF_PLUGIN_CACHE_DIR: ${{ steps.global-cache-dir-path.outputs.dir }}/terraform-plugins
GOCACHE: ${{ steps.global-cache-dir-path.outputs.dir }}/go-cache
TF_PLUGIN_CACHE_DIR: ${{ steps.global-cache-dir-path.outputs.terraform }}
GOCACHE: ${{ steps.global-cache-dir-path.outputs.go }}
Loading

0 comments on commit cdb0f8f

Please sign in to comment.