-
Notifications
You must be signed in to change notification settings - Fork 12
61 lines (56 loc) · 1.64 KB
/
package-aws.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
name: Test AWS Package
on:
workflow_dispatch:
push:
branches: [ main ]
paths:
- 'packages/aws/**'
pull_request:
paths:
- 'packages/aws/**'
jobs:
MAF-AWS:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [18.x, 20.x]
# See supported Node.js release schedule at https://nodejs.org/en/about/previous-releases
steps:
- uses: actions/checkout@v3
- name: Start LocalStack
run: |
pip install localstack==3.0.2
localstack start -d
echo "Waiting for LocalStack startup..."
localstack wait -t 30
echo "LocalStack startup complete"
- 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: npm test -w packages/api
env:
ENVIRONMENT: CI
USE_ENV_VARIABLES: "TRUE"
LOCALSTACK_HOSTNAME: localhost
AWSENV: LOCALSTACK
- 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 }}'