chore:_ CICD remove old layers #2
Workflow file for this run
This file contains hidden or 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: Common CI tests | ||
| run-name: 'Test: mode=${{ inputs.mode }}, testMonorepo=${{ inputs.testMonorepo }}' | ||
| on: | ||
| workflow_call: | ||
| inputs: | ||
| mode: | ||
| description: "'build' (just builded code, used while publishing) or 'global' (real NPM installed globally) or 'local' (real NPM installed locally)" | ||
| type: string | ||
| required: true | ||
| testMonorepo: | ||
| description: 'Test monorepo by specifying folder in config' | ||
| type: string | ||
| required: true | ||
| version: | ||
| description: 'Specify the version of the package' | ||
| type: string | ||
| required: false | ||
| permissions: | ||
| id-token: write | ||
| contents: write | ||
| env: | ||
| REAL_NPM: ${{ inputs.mode == 'global' || inputs.mode == 'local' }} | ||
| TEST_MONOREPO: ${{ inputs.testMonorepo }} | ||
| node_version: 22 | ||
| jobs: | ||
| remove-old-layers: | ||
| runs-on: ubuntu-latest | ||
| concurrency: | ||
| group: remove-all-layers | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| - name: Use Node.js | ||
| uses: actions/setup-node@v4 | ||
| with: | ||
| node-version: ${{ env.node_version }} | ||
| registry-url: 'https://registry.npmjs.org' | ||
| - name: Install dependencies | ||
| run: | | ||
| node prepareForTest.js cdk-basic | ||
| npm i | ||
| - name: Download build artifact | ||
| uses: actions/download-artifact@v4 | ||
| if: ${{ inputs.mode == 'build' }} | ||
| with: | ||
| name: dist | ||
| path: dist | ||
| - name: Install lambda-live-debugger globally | ||
| if: ${{ inputs.mode == 'global' }} | ||
| run: | | ||
| npm i lambda-live-debugger@${{ inputs.version || 'latest' }} -g | ||
| working-directory: test | ||
| - name: Install lambda-live-debugger locally | ||
| if: ${{ inputs.mode == 'local' }} | ||
| run: | | ||
| npm i lambda-live-debugger@${{ inputs.version || 'latest' }} | ||
| working-directory: test | ||
| - name: Configure AWS Credentials | ||
| uses: aws-actions/configure-aws-credentials@v4 | ||
| with: | ||
| aws-region: eu-west-1 | ||
| role-to-assume: ${{ secrets.AWS_ROLE }} | ||
| role-session-name: GitHubActions | ||
| - name: Install lambda-live-debugger globally | ||
| if: ${{ inputs.mode == 'global' }} | ||
| run: | | ||
| lld -r all | ||
| working-directory: test | ||
| - name: Install lambda-live-debugger locally | ||
| if: ${{ inputs.mode == 'local' }} | ||
| run: | | ||
| npx lld -r all | ||
| working-directory: test | ||
| test-cdk-basic: | ||
| runs-on: ubuntu-latest | ||
| needs: remove-old-layers | ||
| concurrency: | ||
| group: test-cdk-basic | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| - name: Use Node.js | ||
| uses: actions/setup-node@v4 | ||
| with: | ||
| node-version: ${{ env.node_version }} | ||
| registry-url: 'https://registry.npmjs.org' | ||
| - name: Install dependencies | ||
| run: | | ||
| node prepareForTest.js cdk-basic | ||
| npm i | ||
| - name: Download build artifact | ||
| uses: actions/download-artifact@v4 | ||
| if: ${{ inputs.mode == 'build' }} | ||
| with: | ||
| name: dist | ||
| path: dist | ||
| - name: Install lambda-live-debugger globally | ||
| if: ${{ inputs.mode == 'global' }} | ||
| run: | | ||
| npm i lambda-live-debugger@${{ inputs.version || 'latest' }} -g | ||
| working-directory: test | ||
| - name: Install lambda-live-debugger locally | ||
| if: ${{ inputs.mode == 'local' }} | ||
| run: | | ||
| npm i lambda-live-debugger@${{ inputs.version || 'latest' }} | ||
| working-directory: test | ||
| - name: Configure AWS Credentials | ||
| uses: aws-actions/configure-aws-credentials@v4 | ||
| with: | ||
| aws-region: eu-west-1 | ||
| role-to-assume: ${{ secrets.AWS_ROLE }} | ||
| role-session-name: GitHubActions | ||
| - name: Destroy | ||
| run: npm run destroy | ||
| working-directory: test/cdk-basic | ||
| continue-on-error: true | ||
| - name: Deploy | ||
| run: npm run deploy | ||
| working-directory: test/cdk-basic | ||
| - name: Test | ||
| run: npx vitest --retry 2 test/cdk-basic.test.ts | ||
| - name: Test - observability mode | ||
| run: OBSERVABLE_MODE=true npx vitest --retry 2 test/cdk-basic.test.ts | ||
| - name: Deploy YAML version | ||
| run: npm run deploy-yaml | ||
| working-directory: test/cdk-basic | ||
| - name: Test YAML | ||
| run: npx vitest --retry 2 test/cdk-basic.test.ts | ||
| test-cdk-esm: | ||
| runs-on: ubuntu-latest | ||
| needs: remove-old-layers | ||
| concurrency: | ||
| group: test-cdk-esm | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| - name: Use Node.js | ||
| uses: actions/setup-node@v4 | ||
| with: | ||
| node-version: ${{ env.node_version }} | ||
| registry-url: 'https://registry.npmjs.org' | ||
| - name: Install dependencies | ||
| run: | | ||
| node prepareForTest.js cdk-esm | ||
| npm i | ||
| - name: Download build artifact | ||
| uses: actions/download-artifact@v4 | ||
| if: ${{ inputs.mode == 'build' }} | ||
| with: | ||
| name: dist | ||
| path: dist | ||
| - name: Install lambda-live-debugger globally | ||
| if: ${{ inputs.mode == 'global' }} | ||
| run: | | ||
| npm i lambda-live-debugger@${{ inputs.version || 'latest' }} -g | ||
| working-directory: test | ||
| - name: Install lambda-live-debugger locally | ||
| if: ${{ inputs.mode == 'local' }} | ||
| run: | | ||
| npm i lambda-live-debugger@${{ inputs.version || 'latest' }} | ||
| working-directory: test | ||
| - name: Configure AWS Credentials | ||
| uses: aws-actions/configure-aws-credentials@v4 | ||
| with: | ||
| aws-region: eu-west-1 | ||
| role-to-assume: ${{ secrets.AWS_ROLE }} | ||
| role-session-name: GitHubActions | ||
| - name: Destroy | ||
| run: npm run destroy | ||
| working-directory: test/cdk-esm | ||
| continue-on-error: true | ||
| - name: Deploy | ||
| run: npm run deploy | ||
| working-directory: test/cdk-esm | ||
| - name: Test | ||
| run: npx vitest --retry 2 test/cdk-esm.test.ts | ||
| - name: Test - observability mode | ||
| run: OBSERVABLE_MODE=true npx vitest --retry 2 test/cdk-esm.test.ts | ||
| test-sls-basic: | ||
| runs-on: ubuntu-latest | ||
| needs: remove-old-layers | ||
| concurrency: | ||
| group: test-sls-basic | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| - name: Use Node.js | ||
| uses: actions/setup-node@v4 | ||
| with: | ||
| node-version: ${{ env.node_version }} | ||
| registry-url: 'https://registry.npmjs.org' | ||
| - name: Install dependencies | ||
| run: | | ||
| node prepareForTest.js sls-basic | ||
| npm i | ||
| - name: Download build artifact | ||
| uses: actions/download-artifact@v4 | ||
| if: ${{ inputs.mode == 'build' }} | ||
| with: | ||
| name: dist | ||
| path: dist | ||
| - name: Install lambda-live-debugger globally | ||
| if: ${{ inputs.mode == 'global' }} | ||
| run: | | ||
| npm i lambda-live-debugger@${{ inputs.version || 'latest' }} -g | ||
| npm i [email protected] -g | ||
| working-directory: test | ||
| - name: Install lambda-live-debugger locally | ||
| if: ${{ inputs.mode == 'local' }} | ||
| run: | | ||
| npm i lambda-live-debugger@${{ inputs.version || 'latest' }} | ||
| working-directory: test | ||
| - name: Configure AWS Credentials | ||
| uses: aws-actions/configure-aws-credentials@v4 | ||
| with: | ||
| aws-region: eu-west-1 | ||
| role-to-assume: ${{ secrets.AWS_ROLE }} | ||
| role-session-name: GitHubActions | ||
| - name: Destroy | ||
| run: npm run destroy | ||
| working-directory: test/sls-basic | ||
| continue-on-error: true | ||
| - name: Deploy | ||
| run: npm run deploy | ||
| working-directory: test/sls-basic | ||
| - name: Test | ||
| run: npx vitest --retry 2 test/sls-basic.test.ts | ||
| - name: Test - observability mode | ||
| run: OBSERVABLE_MODE=true npx vitest --retry 2 test/sls-basic.test.ts | ||
| test-sls-esbuild-cjs: | ||
| runs-on: ubuntu-latest | ||
| needs: remove-old-layers | ||
| concurrency: | ||
| group: test-sls-esbuild-cjs | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| - name: Use Node.js | ||
| uses: actions/setup-node@v4 | ||
| with: | ||
| node-version: ${{ env.node_version }} | ||
| registry-url: 'https://registry.npmjs.org' | ||
| - name: Install dependencies | ||
| run: | | ||
| node prepareForTest.js sls-esbuild-cjs | ||
| npm i | ||
| - name: Download build artifact | ||
| uses: actions/download-artifact@v4 | ||
| if: ${{ inputs.mode == 'build' }} | ||
| with: | ||
| name: dist | ||
| path: dist | ||
| - name: Install lambda-live-debugger globally | ||
| if: ${{ inputs.mode == 'global' }} | ||
| run: | | ||
| npm i lambda-live-debugger@${{ inputs.version || 'latest' }} -g | ||
| npm i [email protected] -g | ||
| working-directory: test | ||
| - name: Install lambda-live-debugger locally | ||
| if: ${{ inputs.mode == 'local' }} | ||
| run: | | ||
| npm i lambda-live-debugger@${{ inputs.version || 'latest' }} | ||
| working-directory: test | ||
| - name: Configure AWS Credentials | ||
| uses: aws-actions/configure-aws-credentials@v4 | ||
| with: | ||
| aws-region: eu-west-1 | ||
| role-to-assume: ${{ secrets.AWS_ROLE }} | ||
| role-session-name: GitHubActions | ||
| - name: Destroy | ||
| run: npm run destroy | ||
| working-directory: test/sls-esbuild-cjs | ||
| continue-on-error: true | ||
| - name: Deploy | ||
| run: npm run deploy | ||
| working-directory: test/sls-esbuild-cjs | ||
| - name: Test | ||
| run: npx vitest --retry 2 test/sls-esbuild-cjs.test.ts | ||
| - name: Test - observability mode | ||
| run: OBSERVABLE_MODE=true npx vitest --retry 2 test/sls-esbuild-cjs.test.ts | ||
| test-sls-esbuild-esm: | ||
| runs-on: ubuntu-latest | ||
| needs: remove-old-layers | ||
| concurrency: | ||
| group: test-sls-esbuild-esm | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| - name: Use Node.js | ||
| uses: actions/setup-node@v4 | ||
| with: | ||
| node-version: ${{ env.node_version }} | ||
| registry-url: 'https://registry.npmjs.org' | ||
| - name: Install dependencies | ||
| run: | | ||
| node prepareForTest.js sls-esbuild-esm | ||
| npm i | ||
| - name: Download build artifact | ||
| uses: actions/download-artifact@v4 | ||
| if: ${{ inputs.mode == 'build' }} | ||
| with: | ||
| name: dist | ||
| path: dist | ||
| - name: Install lambda-live-debugger globally | ||
| if: ${{ inputs.mode == 'global' }} | ||
| run: | | ||
| npm i lambda-live-debugger@${{ inputs.version || 'latest' }} -g | ||
| npm i [email protected] -g | ||
| working-directory: test | ||
| - name: Install lambda-live-debugger locally | ||
| if: ${{ inputs.mode == 'local' }} | ||
| run: | | ||
| npm i lambda-live-debugger@${{ inputs.version || 'latest' }} | ||
| working-directory: test | ||
| - name: Configure AWS Credentials | ||
| uses: aws-actions/configure-aws-credentials@v4 | ||
| with: | ||
| aws-region: eu-west-1 | ||
| role-to-assume: ${{ secrets.AWS_ROLE }} | ||
| role-session-name: GitHubActions | ||
| - name: Destroy | ||
| run: npm run destroy | ||
| working-directory: test/sls-esbuild-esm | ||
| continue-on-error: true | ||
| - name: Deploy | ||
| run: npm run deploy | ||
| working-directory: test/sls-esbuild-esm | ||
| - name: Test | ||
| run: npx vitest --retry 2 test/sls-esbuild-esm.test.ts | ||
| - name: Test - observability mode | ||
| run: OBSERVABLE_MODE=true npx vitest --retry 2 test/sls-esbuild-esm.test.ts | ||
| test-osls-basic: | ||
| runs-on: ubuntu-latest | ||
| needs: remove-old-layers | ||
| concurrency: | ||
| group: test-osls-basic | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| - name: Use Node.js | ||
| uses: actions/setup-node@v4 | ||
| with: | ||
| node-version: ${{ env.node_version }} | ||
| registry-url: 'https://registry.npmjs.org' | ||
| - name: Install dependencies | ||
| run: | | ||
| node prepareForTest.js osls-basic | ||
| npm i | ||
| - name: Download build artifact | ||
| uses: actions/download-artifact@v4 | ||
| if: ${{ inputs.mode == 'build' }} | ||
| with: | ||
| name: dist | ||
| path: dist | ||
| - name: Install lambda-live-debugger globally | ||
| if: ${{ inputs.mode == 'global' }} | ||
| run: | | ||
| npm i lambda-live-debugger@${{ inputs.version || 'latest' }} -g | ||
| npm i osls -g | ||
| working-directory: test | ||
| - name: Install lambda-live-debugger locally | ||
| if: ${{ inputs.mode == 'local' }} | ||
| run: | | ||
| npm i lambda-live-debugger@${{ inputs.version || 'latest' }} | ||
| working-directory: test | ||
| - name: Configure AWS Credentials | ||
| uses: aws-actions/configure-aws-credentials@v4 | ||
| with: | ||
| aws-region: eu-west-1 | ||
| role-to-assume: ${{ secrets.AWS_ROLE }} | ||
| role-session-name: GitHubActions | ||
| - name: Destroy | ||
| run: npm run destroy | ||
| working-directory: test/osls-basic | ||
| continue-on-error: true | ||
| - name: Deploy | ||
| run: npm run deploy | ||
| working-directory: test/osls-basic | ||
| - name: Test | ||
| run: npx vitest --retry 2 test/osls-basic.test.ts | ||
| - name: Test - observability mode | ||
| run: OBSERVABLE_MODE=true npx vitest --retry 2 test/osls-basic.test.ts | ||
| test-osls-esbuild-cjs: | ||
| runs-on: ubuntu-latest | ||
| needs: remove-old-layers | ||
| concurrency: | ||
| group: test-osls-esbuild-cjs | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| - name: Use Node.js | ||
| uses: actions/setup-node@v4 | ||
| with: | ||
| node-version: ${{ env.node_version }} | ||
| registry-url: 'https://registry.npmjs.org' | ||
| - name: Install dependencies | ||
| run: | | ||
| node prepareForTest.js osls-esbuild-cjs | ||
| npm i | ||
| - name: Download build artifact | ||
| uses: actions/download-artifact@v4 | ||
| if: ${{ inputs.mode == 'build' }} | ||
| with: | ||
| name: dist | ||
| path: dist | ||
| - name: Install lambda-live-debugger globally | ||
| if: ${{ inputs.mode == 'global' }} | ||
| run: | | ||
| npm i lambda-live-debugger@${{ inputs.version || 'latest' }} -g | ||
| npm i osls -g | ||
| working-directory: test | ||
| - name: Install lambda-live-debugger locally | ||
| if: ${{ inputs.mode == 'local' }} | ||
| run: | | ||
| npm i lambda-live-debugger@${{ inputs.version || 'latest' }} | ||
| working-directory: test | ||
| - name: Configure AWS Credentials | ||
| uses: aws-actions/configure-aws-credentials@v4 | ||
| with: | ||
| aws-region: eu-west-1 | ||
| role-to-assume: ${{ secrets.AWS_ROLE }} | ||
| role-session-name: GitHubActions | ||
| - name: Destroy | ||
| run: npm run destroy | ||
| working-directory: test/osls-esbuild-cjs | ||
| continue-on-error: true | ||
| - name: Deploy | ||
| run: npm run deploy | ||
| working-directory: test/osls-esbuild-cjs | ||
| - name: Test | ||
| run: npx vitest --retry 2 test/osls-esbuild-cjs.test.ts | ||
| - name: Test - observability mode | ||
| run: OBSERVABLE_MODE=true npx vitest --retry 2 test/osls-esbuild-cjs.test.ts | ||
| test-osls-esbuild-esm: | ||
| runs-on: ubuntu-latest | ||
| needs: remove-old-layers | ||
| concurrency: | ||
| group: test-osls-esbuild-esm | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| - name: Use Node.js | ||
| uses: actions/setup-node@v4 | ||
| with: | ||
| node-version: ${{ env.node_version }} | ||
| registry-url: 'https://registry.npmjs.org' | ||
| - name: Install dependencies | ||
| run: | | ||
| node prepareForTest.js osls-esbuild-esm | ||
| npm i | ||
| - name: Download build artifact | ||
| uses: actions/download-artifact@v4 | ||
| if: ${{ inputs.mode == 'build' }} | ||
| with: | ||
| name: dist | ||
| path: dist | ||
| - name: Install lambda-live-debugger globally | ||
| if: ${{ inputs.mode == 'global' }} | ||
| run: | | ||
| npm i lambda-live-debugger@${{ inputs.version || 'latest' }} -g | ||
| npm i osls -g | ||
| working-directory: test | ||
| - name: Install lambda-live-debugger locally | ||
| if: ${{ inputs.mode == 'local' }} | ||
| run: | | ||
| npm i lambda-live-debugger@${{ inputs.version || 'latest' }} | ||
| working-directory: test | ||
| - name: Configure AWS Credentials | ||
| uses: aws-actions/configure-aws-credentials@v4 | ||
| with: | ||
| aws-region: eu-west-1 | ||
| role-to-assume: ${{ secrets.AWS_ROLE }} | ||
| role-session-name: GitHubActions | ||
| - name: Destroy | ||
| run: npm run destroy | ||
| working-directory: test/osls-esbuild-esm | ||
| continue-on-error: true | ||
| - name: Deploy | ||
| run: npm run deploy | ||
| working-directory: test/osls-esbuild-esm | ||
| - name: Test | ||
| run: npx vitest --retry 2 test/osls-esbuild-esm.test.ts | ||
| - name: Test - observability mode | ||
| run: OBSERVABLE_MODE=true npx vitest --retry 2 test/osls-esbuild-esm.test.ts | ||
| test-sam-basic: | ||
| runs-on: ubuntu-latest | ||
| needs: remove-old-layers | ||
| concurrency: | ||
| group: test-sam-basic | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| - uses: aws-actions/setup-sam@v2 | ||
| with: | ||
| use-installer: true | ||
| token: ${{ secrets.GITHUB_TOKEN }} | ||
| - name: Use Node.js | ||
| uses: actions/setup-node@v4 | ||
| with: | ||
| node-version: ${{ env.node_version }} | ||
| registry-url: 'https://registry.npmjs.org' | ||
| - name: Install dependencies | ||
| run: | | ||
| node prepareForTest.js sam-basic | ||
| npm i | ||
| - name: Download build artifact | ||
| uses: actions/download-artifact@v4 | ||
| if: ${{ inputs.mode == 'build' }} | ||
| with: | ||
| name: dist | ||
| path: dist | ||
| - name: Install lambda-live-debugger globally | ||
| if: ${{ inputs.mode == 'global' }} | ||
| run: | | ||
| npm i lambda-live-debugger@${{ inputs.version || 'latest' }} -g | ||
| working-directory: test | ||
| - name: Install lambda-live-debugger locally | ||
| if: ${{ inputs.mode == 'local' }} | ||
| run: | | ||
| npm i lambda-live-debugger@${{ inputs.version || 'latest' }} | ||
| working-directory: test | ||
| - name: Configure AWS Credentials | ||
| uses: aws-actions/configure-aws-credentials@v4 | ||
| with: | ||
| aws-region: eu-west-1 | ||
| role-to-assume: ${{ secrets.AWS_ROLE }} | ||
| role-session-name: GitHubActions | ||
| - name: Destroy | ||
| run: npm run destroy | ||
| working-directory: test/sam-basic | ||
| continue-on-error: true | ||
| - name: Deploy | ||
| run: npm run deploy | ||
| working-directory: test/sam-basic | ||
| - name: Test | ||
| run: npx vitest --retry 2 test/sam-basic.test.ts | ||
| - name: Test - observability mode | ||
| run: OBSERVABLE_MODE=true npx vitest --retry 2 test/sam-basic.test.ts | ||
| test-sam-alt: | ||
| runs-on: ubuntu-latest | ||
| needs: remove-old-layers | ||
| concurrency: | ||
| group: test-sam-alt | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| - uses: aws-actions/setup-sam@v2 | ||
| with: | ||
| use-installer: true | ||
| token: ${{ secrets.GITHUB_TOKEN }} | ||
| - name: Use Node.js | ||
| uses: actions/setup-node@v4 | ||
| with: | ||
| node-version: ${{ env.node_version }} | ||
| registry-url: 'https://registry.npmjs.org' | ||
| - name: Install dependencies | ||
| run: | | ||
| node prepareForTest.js sam-alt | ||
| npm i | ||
| - name: Download build artifact | ||
| uses: actions/download-artifact@v4 | ||
| if: ${{ inputs.mode == 'build' }} | ||
| with: | ||
| name: dist | ||
| path: dist | ||
| - name: Install lambda-live-debugger globally | ||
| if: ${{ inputs.mode == 'global' }} | ||
| run: | | ||
| npm i lambda-live-debugger@${{ inputs.version || 'latest' }} -g | ||
| working-directory: test | ||
| - name: Install lambda-live-debugger locally | ||
| if: ${{ inputs.mode == 'local' }} | ||
| run: | | ||
| npm i lambda-live-debugger@${{ inputs.version || 'latest' }} | ||
| working-directory: test | ||
| - name: Configure AWS Credentials | ||
| uses: aws-actions/configure-aws-credentials@v4 | ||
| with: | ||
| aws-region: eu-west-1 | ||
| role-to-assume: ${{ secrets.AWS_ROLE }} | ||
| role-session-name: GitHubActions | ||
| - name: Destroy | ||
| run: npm run destroy | ||
| working-directory: test/sam-alt | ||
| continue-on-error: true | ||
| - name: Deploy | ||
| run: npm run deploy | ||
| working-directory: test/sam-alt | ||
| - name: Test | ||
| run: npx vitest --retry 2 test/sam-alt.test.ts | ||
| - name: Test - observability mode | ||
| run: OBSERVABLE_MODE=true npx vitest --retry 2 test/sam-alt.test.ts | ||
| test-terraform-basic: | ||
| runs-on: ubuntu-latest | ||
| needs: remove-old-layers | ||
| concurrency: | ||
| group: test-terraform-basic | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| - name: Use Node.js | ||
| uses: actions/setup-node@v4 | ||
| with: | ||
| node-version: ${{ env.node_version }} | ||
| registry-url: 'https://registry.npmjs.org' | ||
| - name: Install dependencies | ||
| run: | | ||
| node prepareForTest.js terraform-basic | ||
| npm i | ||
| - name: Download build artifact | ||
| uses: actions/download-artifact@v4 | ||
| if: ${{ inputs.mode == 'build' }} | ||
| with: | ||
| name: dist | ||
| path: dist | ||
| - name: Install lambda-live-debugger globally | ||
| if: ${{ inputs.mode == 'global' }} | ||
| run: | | ||
| npm i lambda-live-debugger@${{ inputs.version || 'latest' }} -g | ||
| working-directory: test | ||
| - name: Install lambda-live-debugger locally | ||
| if: ${{ inputs.mode == 'local' }} | ||
| run: | | ||
| npm i lambda-live-debugger@${{ inputs.version || 'latest' }} | ||
| working-directory: test | ||
| - name: Configure AWS Credentials | ||
| uses: aws-actions/configure-aws-credentials@v4 | ||
| with: | ||
| aws-region: eu-west-1 | ||
| role-to-assume: ${{ secrets.AWS_ROLE }} | ||
| role-session-name: GitHubActions | ||
| - name: Setup Terraform | ||
| uses: hashicorp/setup-terraform@v3 | ||
| - name: Terraform Init | ||
| run: | | ||
| ./create_bucket.sh lld-terraform-basic | ||
| terraform init -backend-config="bucket=lld-terraform-basic" | ||
| working-directory: test/terraform-basic | ||
| - name: Destroy | ||
| run: npm run destroy | ||
| working-directory: test/terraform-basic | ||
| continue-on-error: true | ||
| - name: Deploy | ||
| run: npm run deploy | ||
| working-directory: test/terraform-basic | ||
| - name: Test | ||
| run: npx vitest --retry 2 test/terraform-basic.test.ts | ||
| - name: Test - observability mode | ||
| run: OBSERVABLE_MODE=true npx vitest --retry 2 test/terraform-basic.test.ts | ||
| test-opentofu-basic: | ||
| runs-on: ubuntu-latest | ||
| needs: remove-old-layers | ||
| concurrency: | ||
| group: test-opentofu-basic | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| - name: Use Node.js | ||
| uses: actions/setup-node@v4 | ||
| with: | ||
| node-version: ${{ env.node_version }} | ||
| registry-url: 'https://registry.npmjs.org' | ||
| - name: Install dependencies | ||
| run: | | ||
| node prepareForTest.js opentofu-basic | ||
| npm i | ||
| - name: Download build artifact | ||
| uses: actions/download-artifact@v4 | ||
| if: ${{ inputs.mode == 'build' }} | ||
| with: | ||
| name: dist | ||
| path: dist | ||
| - name: Install lambda-live-debugger globally | ||
| if: ${{ inputs.mode == 'global' }} | ||
| run: | | ||
| npm i lambda-live-debugger@${{ inputs.version || 'latest' }} -g | ||
| working-directory: test | ||
| - name: Install lambda-live-debugger locally | ||
| if: ${{ inputs.mode == 'local' }} | ||
| run: | | ||
| npm i lambda-live-debugger@${{ inputs.version || 'latest' }} | ||
| working-directory: test | ||
| - name: Configure AWS Credentials | ||
| uses: aws-actions/configure-aws-credentials@v4 | ||
| with: | ||
| aws-region: eu-west-1 | ||
| role-to-assume: ${{ secrets.AWS_ROLE }} | ||
| role-session-name: GitHubActions | ||
| - name: Setup OpenTofu | ||
| uses: opentofu/setup-opentofu@v1 | ||
| - name: OpenTofu Init | ||
| run: | | ||
| ./create_bucket.sh lld-opentofu-basic | ||
| tofu init -backend-config="bucket=lld-opentofu-basic" | ||
| working-directory: test/opentofu-basic | ||
| - name: Destroy | ||
| run: npm run destroy | ||
| working-directory: test/opentofu-basic | ||
| continue-on-error: true | ||
| - name: Deploy | ||
| run: npm run deploy | ||
| working-directory: test/opentofu-basic | ||
| - name: Test | ||
| run: npx vitest --retry 2 test/opentofu-basic.test.ts | ||
| - name: Test - observability mode | ||
| run: OBSERVABLE_MODE=true npx vitest --retry 2 test/opentofu-basic.test.ts | ||