-
-
Notifications
You must be signed in to change notification settings - Fork 0
139 lines (111 loc) · 3.25 KB
/
ci.yml
File metadata and controls
139 lines (111 loc) · 3.25 KB
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
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
name: CI
on:
pull_request:
push:
branches:
- main
permissions:
contents: read
id-token: write
env:
TF_IN_AUTOMATION: "1"
jobs:
build:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
arch: [arm64, x64]
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: "18"
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: "3.11"
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: "1.22"
- name: Setup Java
uses: actions/setup-java@v4
with:
distribution: "temurin"
java-version: "17"
- name: Setup Rust
uses: dtolnay/rust-toolchain@stable
- name: Add Rust target
run: |
if [ "${{ matrix.arch }}" = "arm64" ]; then
rustup target add aarch64-unknown-linux-gnu
else
rustup target add x86_64-unknown-linux-gnu
fi
- name: Setup Terraform
uses: hashicorp/setup-terraform@v3
with:
terraform_version: "1.5.7"
- name: Package functions
env:
PACKAGE_ARCH: ${{ matrix.arch }}
run: bash scripts/package.sh
- name: Upload packaged artifacts
uses: actions/upload-artifact@v4
with:
name: lambda-packages-${{ matrix.arch }}
path: dist/*.zip
if-no-files-found: error
- name: Sync Terraform inputs
run: node scripts/sync-terraform.js
- name: Terraform init
run: terraform -chdir=infra init -input=false
- name: Terraform validate
run: terraform -chdir=infra validate
# deploy:
# runs-on: ubuntu-latest
# needs: build
# if: github.event_name == 'push' && github.ref == 'refs/heads/main'
# steps:
# - name: Checkout
# uses: actions/checkout@v4
# - name: Setup Node
# uses: actions/setup-node@v4
# with:
# node-version: "18"
# - name: Setup Python
# uses: actions/setup-python@v5
# with:
# python-version: "3.11"
# - name: Setup Go
# uses: actions/setup-go@v5
# with:
# go-version: "1.22"
# - name: Setup Java
# uses: actions/setup-java@v4
# with:
# distribution: "temurin"
# java-version: "17"
# - name: Setup Rust
# uses: dtolnay/rust-toolchain@stable
# - name: Setup Terraform
# uses: hashicorp/setup-terraform@v3
# with:
# terraform_version: "1.5.7"
# - name: Configure AWS credentials (OIDC)
# uses: aws-actions/configure-aws-credentials@v4
# with:
# role-to-assume: ${{ secrets.AWS_ROLE_ARN }}
# aws-region: ${{ secrets.AWS_REGION }}
# role-session-name: lambda-monorepo-ci
# - name: Package functions
# run: bash scripts/package.sh
# - name: Sync Terraform inputs
# run: node scripts/sync-terraform.js
# - name: Terraform init
# run: terraform -chdir=infra init -input=false
# - name: Terraform apply
# run: terraform -chdir=infra apply -auto-approve