Skip to content

Merge pull request #41 from fargito/feat/remove-aws-sdk-from-bundles #78

Merge pull request #41 from fargito/feat/remove-aws-sdk-from-bundles

Merge pull request #41 from fargito/feat/remove-aws-sdk-from-bundles #78

Workflow file for this run

on:
push:
branches:
- main
tags-ignore:
- "v*" # exclude version tags
name: 🚀 Merge main
concurrency: merge_main
permissions:
id-token: write # this is required for AWS https://github.com/aws-actions/configure-aws-credentials#usage
contents: read # this is required for Nx https://github.com/nrwl/nx-set-shas#permissions-in-v2
actions: read # this is required for Nx https://github.com/nrwl/nx-set-shas#permissions-in-v2
env:
CI: true
AWS_REGION: eu-west-1
defaults:
run:
shell: bash
jobs:
build-and-test:
name: 🏗 Build Project, 🧪 Run Tests & 🚀 Deploy staging
runs-on: ubuntu-latest
environment: staging
timeout-minutes: 30
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha }}
# We need to fetch all branches and commits so that Nx affected has a base to compare against.
fetch-depth: 0
- uses: nrwl/nx-set-shas@v4
- uses: pnpm/action-setup@v2.4.0
- name: Setup Node.js
id: setup-node
uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
cache: 'pnpm'
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: 💾 Cache Nx cache
id: package-cache
uses: actions/cache@v3
with:
path: |
nx-cache
# Cache will be updated at every run: https://github.com/actions/cache/blob/main/workarounds.md#update-a-cache
key: ${{ runner.os }}-nx-cache-${{ steps.setup-node.outputs.node-version }}-${{ github.run_id }}
restore-keys: |
${{ runner.os }}-nx-cache-${{ steps.setup-node.outputs.node-version }}-
${{ runner.os }}-nx-cache-
- name: '🏗 Package'
run: pnpm nx affected --targets=package,build --parallel=2
- name: '🧪 Run tests'
run: pnpm nx affected --targets=test-linter,test-type,test-unit,test-circular --parallel=2
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v4
with:
aws-region: ${{ env.AWS_REGION }}
role-to-assume: ${{ secrets.AWS_DEPLOY_ROLE_STAGING }}
- name: '🚀 Deploy staging'
run: pnpm nx affected --target=deploy-staging --parallel=2
- name: '🔎 Run integration tests on staging'
run: SLS_ENV=staging pnpm nx affected --target=test-integration --parallel=2