1010
1111env :
1212 CARGO_TERM_COLOR : always
13+ RUST_LOG : info
1314
1415jobs :
1516 test :
4142 cp Cargo-1.70.lock Cargo.lock
4243 echo "CARGO_LOCKED=--locked" >> $GITHUB_ENV
4344
44- # FIXME: also run petstore integration tests
4545 - name : Run default tests
46- run : cargo ${CARGO_LOCKED} test
46+ run : cargo ${CARGO_LOCKED} test -vv
47+
48+ petstore-test :
49+ name : Run Petstore example tests
50+ runs-on : ${{ matrix.rust_os.os }}
51+ strategy :
52+ fail-fast : false
53+ matrix :
54+ rust_os :
55+ - { rust: 1.70.0, os: ubuntu-22.04 }
56+ - { rust: stable, os: ubuntu-22.04 }
57+ - { rust: beta, os: ubuntu-22.04 }
58+ - { rust: nightly, os: ubuntu-22.04 }
59+
60+ steps :
61+ - uses : actions/checkout@v4
62+
63+ - name : Install Rust toolchain
64+ uses : dtolnay/rust-toolchain@master
65+ with :
66+ toolchain : ${{ matrix.rust_os.rust }}
67+ components : rustfmt
68+
69+ - name : Install AWS SAM CLI
70+ uses : aws-actions/setup-sam@v2
71+ with :
72+ use-installer : true
73+
74+ # The Petstore example builds for ARM64, but GitHub runners are all x86-64, so we need QEMU.
75+ # See https://github.com/aws/aws-sam-cli/issues/3169#issuecomment-906729604.
76+ - name : Install QEMU
77+ run : docker run --rm --privileged multiarch/qemu-user-static --reset -p yes
78+
79+ - name : Install Zig toolchain
80+ uses : korandoru/setup-zig@v1
81+ with :
82+ zig-version : 0.10.0
83+
84+ # See https://www.cargo-lambda.info/guide/getting-started.html#github-actions.
85+ - name : Install Cargo Lambda
86+ uses : jaxxstorm/action-install-gh-release@v1
87+ with :
88+ repo : cargo-lambda/cargo-lambda
89+ tag : v1.0.1
90+ platform : linux
91+ arch : x86_64
92+
93+ # Newer dependency versions may not support rustc 1.70, so we use a Cargo.lock file for those
94+ # builds along with `--locked`.
95+ - name : Use Rust 1.70 lockfile
96+ if : ${{ matrix.rust_os.rust == '1.70.0' }}
97+ run : |
98+ cp Cargo-1.70.lock Cargo.lock
99+ echo "CARGO_LOCKED=--locked" >> $GITHUB_ENV
100+
101+ - name : Build Petstore example SAM template
102+ working-directory : examples/petstore
103+ run : sam build
104+
105+ # NB: Most of the logs produced here will be in the Post action!
106+ - name : Start Petstore example local API
107+ uses : JarvusInnovations/background-action@v1
108+ with :
109+ run : sam local start-api &
110+ wait-on : tcp:localhost:3000
111+ working-directory : examples/petstore
112+ tail : true
113+ log-output-if : true
114+
115+ - name : Run Petstore example integration tests
116+ run : cargo test -p petstore -vv -- --ignored
47117
48118 clippy-fmt :
49119 name : Cargo fmt + clippy (MSRV only)
@@ -62,12 +132,12 @@ jobs:
62132 run : cp Cargo-1.70.lock Cargo.lock
63133
64134 - name : Run Clippy
65- run : cargo --locked clippy --all -- --deny warnings
135+ run : cargo --locked clippy --all -vv - - --deny warnings
66136
67137 # Cargo fmt doesn't run build.rs, so we need to run clippy first in order for
68138 # openapi-lambda-test to pass (since it depends on the .openapi-lambda output directory).
69139 - name : Check fmt
70- run : cargo --locked fmt --all -- --check
140+ run : cargo --locked fmt --all -v - - --check
71141
72142 audit :
73143 name : Cargo Audit (stable only)
0 commit comments