From b3137ba005effeddfc9097e6b7edaece1e42d208 Mon Sep 17 00:00:00 2001 From: Sebastian Korfmann Date: Wed, 28 Jun 2023 14:32:21 +0200 Subject: [PATCH 1/4] Testing the workflow --- .github/workflows/test.yml | 63 +++++++++++++++++++------------------- 1 file changed, 31 insertions(+), 32 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 2d9a0fd..03282b4 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -11,39 +11,38 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 - - run: | - npm install - - run: | - npm run all + - uses: pnpm/action-setup@v2 + name: Install pnpm + id: pnpm-install + with: + version: 8 + + - name: Install dependencies + run: pnpm install + + - name: Rebuild the dist/ directories + run: | + pnpm run -r build + pnpm run -r package + test: # make sure the action works on a clean machine without building runs-on: ubuntu-latest - # env: # set the env vars for the action - # AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} - # AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} - # AWS_DEFAULT_REGION: 'us-east-1' - # TF_BACKEND_BUCKET: foo - # TF_BACKEND_BUCKET_REGION: 'us-east-1' + env: + AWS_DEFAULT_REGION: 'us-east-1' + TF_BACKEND_BUCKET: ${{ secrets.TF_BACKEND_BUCKET }} + TF_BACKEND_BUCKET_REGION: 'us-east-1' steps: - uses: actions/checkout@v3 - # local testing only for now - # - uses: ./ - # name: "Plain Wing app" - # with: - # entry: './examples/plain/main.w' - # target: 'tf-aws' - # backend: 's3' - # - uses: ./ - # name: "Wing app with npm dependencies" - # with: - # entry: 'main.w' - # working-directory: 'examples/with-dependencies' - # target: 'tf-aws' - # backend: 's3' - # - uses: ./actions/deploy - # name: "Wing app with cdktf dependency" - # with: - # version: '0.21.4' - # entry: 'main.w' - # working-directory: 'examples/with-cdktf' - # target: 'tf-aws' - # backend: 's3' \ No newline at end of file + - name: Configure AWS Credentials + uses: aws-actions/configure-aws-credentials@v2 + with: + role-to-assume: ${{ secrets.AWS_ROLE_ARN }} + role-session-name: gh-action-winglang + aws-region: ${{ env.AWS_DEFAULT_REGION }} + - uses: ./actions/deploy + name: "Plain Wing app" + with: + entry: 'main.w' + working-directory: './examples/plain' + target: 'tf-aws' + backend: 's3' \ No newline at end of file From 1952b17daede470bdc7cf652e5834547d5911d6e Mon Sep 17 00:00:00 2001 From: Sebastian Korfmann Date: Wed, 28 Jun 2023 14:42:24 +0200 Subject: [PATCH 2/4] Non conrrent runs and credentials --- .github/workflows/test.yml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 03282b4..f76c850 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -6,6 +6,14 @@ on: # rebuild any PRs and main branch changes - main - 'releases/*' +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: false + +permissions: + id-token: write # This is required for requesting the JWT + contents: read # This is required for actions/checkout + jobs: build: # make sure build/ci work properly runs-on: ubuntu-latest From e6117650ab7b11e637c22b19c3a1fcf557e204df Mon Sep 17 00:00:00 2001 From: Sebastian Korfmann Date: Wed, 28 Jun 2023 15:00:45 +0200 Subject: [PATCH 3/4] All exampless --- .github/workflows/test.yml | 45 +++++++++++++++++++++++++++++++++++++- 1 file changed, 44 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index f76c850..df4ab7e 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -33,7 +33,7 @@ jobs: pnpm run -r build pnpm run -r package - test: # make sure the action works on a clean machine without building + test-plain: runs-on: ubuntu-latest env: AWS_DEFAULT_REGION: 'us-east-1' @@ -53,4 +53,47 @@ jobs: entry: 'main.w' working-directory: './examples/plain' target: 'tf-aws' + backend: 's3' + test-cdktf: + runs-on: ubuntu-latest + env: + AWS_DEFAULT_REGION: 'us-east-1' + TF_BACKEND_BUCKET: ${{ secrets.TF_BACKEND_BUCKET }} + TF_BACKEND_BUCKET_REGION: 'us-east-1' + steps: + - uses: actions/checkout@v3 + - name: Configure AWS Credentials + uses: aws-actions/configure-aws-credentials@v2 + with: + role-to-assume: ${{ secrets.AWS_ROLE_ARN }} + role-session-name: gh-action-winglang + aws-region: ${{ env.AWS_DEFAULT_REGION }} + - uses: ./actions/deploy + name: "Plain Wing app" + with: + entry: 'main.w' + working-directory: './examples/with-cdktf' + target: 'tf-aws' + backend: 's3' + + test-dependencies: + runs-on: ubuntu-latest + env: + AWS_DEFAULT_REGION: 'us-east-1' + TF_BACKEND_BUCKET: ${{ secrets.TF_BACKEND_BUCKET }} + TF_BACKEND_BUCKET_REGION: 'us-east-1' + steps: + - uses: actions/checkout@v3 + - name: Configure AWS Credentials + uses: aws-actions/configure-aws-credentials@v2 + with: + role-to-assume: ${{ secrets.AWS_ROLE_ARN }} + role-session-name: gh-action-winglang + aws-region: ${{ env.AWS_DEFAULT_REGION }} + - uses: ./actions/deploy + name: "Plain Wing app" + with: + entry: 'main.w' + working-directory: './examples/with-dependencies' + target: 'tf-aws' backend: 's3' \ No newline at end of file From 48b3bd25c4851cbe28646d989c9da3131d381202 Mon Sep 17 00:00:00 2001 From: Sebastian Korfmann Date: Tue, 11 Jul 2023 16:37:03 +0200 Subject: [PATCH 4/4] trigger build