Skip to content

Set AWS steps to point to AWS services by default (Set AWSENV to LOCALSTACK to test on localstack) #238

Set AWS steps to point to AWS services by default (Set AWSENV to LOCALSTACK to test on localstack)

Set AWS steps to point to AWS services by default (Set AWSENV to LOCALSTACK to test on localstack) #238

Workflow file for this run

# This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node.
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions
name: Build / Test
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
build:
runs-on: ubuntu-latest
services:
localstack:
image: localstack/localstack:0.14.4
ports:
- 4566:4566
strategy:
matrix:
node-version: [18.x, 20.x]
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/
steps:
- uses: actions/checkout@v3
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- name: Setup Terraform
uses: hashicorp/[email protected]
- run: mkdir ~/.aws/
- run: echo -e "[default]\noutput = json\nregion = us-east-1\naws_access_key_id = foo\naws_secret_access_key = bar" > ~/.aws/credentials
- run: npm ci
- name: Terraform - apply to localstack
run: |
terraform init
terraform plan
terraform apply -auto-approve
- run: npx lerna run test
env:
ENVIRONMENT: CI
USE_ENV_VARIABLES: "TRUE"
FAKE_SQL_USERNAME: MAF
FAKE_SQL_PASSWORD: MAF
LOCALSTACK_HOSTNAME: localhost
- name: Status Create Action
if: ${{ always() }}
uses: hkusu/[email protected]
id: status-create
with:
state: ${{ job.status }}
sha: ${{ github.sha }}
- name: Show result
if: always()
run: echo '${{ steps.status-create.outputs.result }}'