-
Notifications
You must be signed in to change notification settings - Fork 0
106 lines (81 loc) · 2.35 KB
/
push-main.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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
on:
push:
branches:
- main
tags-ignore:
- 'v*' # exclude version tags
name: 🚀 Push main
concurrency: push_main
permissions:
id-token: write # this is required for AWS https://github.com/aws-actions/configure-aws-credentials#usage
env:
CI: true
AWS_REGION: eu-west-1
STAGE: production
defaults:
run:
shell: bash
jobs:
build-and-test:
name: 🏗 Build & 🧪 Test & 🚀 Deploy
runs-on: ubuntu-latest
environment: production
timeout-minutes: 30
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup pnpm
uses: pnpm/[email protected]
- name: Setup Node.js
id: setup-node
uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
cache: pnpm
- name: Install Node.js dependencies
run: pnpm install --frozen-lockfile
- name: Cache Rust build
uses: Swatinem/rust-cache@v2
with:
workspaces: 'rust-lambdas -> target'
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
- name: Install Zig toolchain
uses: korandoru/[email protected]
with:
zig-version: 0.11.0
- name: Install Cargo Lambda
uses: jaxxstorm/[email protected]
with:
repo: cargo-lambda/cargo-lambda
platform: linux
arch: x86_64
- name: Build Rust Lambdas
run: pnpm build
- name: Check Rust code
run: cargo check-lambdas
- name: Test Rust code
run: cargo test-lambdas
- name: 🧪 Check format
run: pnpm format-check
- name: 🧪 Test linter
run: pnpm test-linter
- name: 🏗 Test types
run: pnpm test-type
- name: 🏗 Test unit
run: pnpm test-unit
- name: ⛅ Test CDK
run: pnpm test-cdk
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v4
with:
aws-region: ${{ env.AWS_REGION }}
role-to-assume: ${{ secrets.AWS_DEPLOY_ROLE }}
- name: CDK Bootstrap
run: pnpm run bootstrap
- name: 🚀 Deploy
run: pnpm run deploy --context stage=production
- name: 🔎 Run integration tests
run: pnpm test-integration
- name: 🧹 CDK garbage collection
run: pnpm run clean