-
Notifications
You must be signed in to change notification settings - Fork 162
75 lines (58 loc) · 1.92 KB
/
Copy pathpr.yaml
File metadata and controls
75 lines (58 loc) · 1.92 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
name: PR
on:
pull_request:
branches:
- main
paths-ignore:
- "docs/**"
- "examples/**"
permissions:
contents: read
env:
CARGO_TERM_COLOR: always
SAM_TEMPLATE_X86_64: template-x86_64.yaml
SAM_TEMPLATE_ARM64: template-arm64.yaml
RUST_BACKTRACE: full
jobs:
test:
runs-on: ubuntu-24.04
steps:
- name: Checkout sources
uses: actions/checkout@v4
- name: Configure Rust cache
uses: Swatinem/rust-cache@v2
- name: Install cargo-nextest
run: curl -LsSf https://get.nexte.st/latest/linux | tar zxf - -C ${CARGO_HOME:-~/.cargo}/bin
- name: linting
run: |
cargo fmt --all -- --check
cargo clippy -- -Dwarnings
- name: run unit and integration tests
run: cargo nextest run --profile ci
build:
needs: [test]
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
with:
python-version: "3.13"
- uses: aws-actions/setup-sam@v2
with:
use-installer: true
token: ${{ secrets.GITHUB_TOKEN }}
- name: Install stable toolchain
run: |
rustup target add x86_64-unknown-linux-musl
rustup target add aarch64-unknown-linux-musl
- name: Install cargo lambda
run: pip3 install cargo-lambda
- name: Configure Rust cache
uses: Swatinem/rust-cache@v2
- name: Add cargo pkg version to env vars
run: |
echo "CARGO_PKG_VERSION=$(cargo metadata --no-deps --format-version=1 | jq -r '.packages[0].version')" >> $GITHUB_ENV
- name: Build x86_64 Layer
run: sam build --template ${SAM_TEMPLATE_X86_64} --parameter-overrides CargoPkgVersion=${CARGO_PKG_VERSION} -b build-x86_64
- name: Build arm64 Layer
run: sam build --template ${SAM_TEMPLATE_ARM64} --parameter-overrides CargoPkgVersion=${CARGO_PKG_VERSION} -b build-arm64