-
Notifications
You must be signed in to change notification settings - Fork 32
96 lines (82 loc) · 3 KB
/
Copy pathexamples.yml
File metadata and controls
96 lines (82 loc) · 3 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
name: Examples
on:
push:
branches: [main]
pull_request:
branches: [main]
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.run_id }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
env:
CARGO_TERM_COLOR: always
jobs:
changes:
runs-on: ubuntu-latest
timeout-minutes: 45
outputs:
code: ${{ steps.detect.outputs.code || 'true' }}
steps:
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
- if: github.event_name == 'pull_request'
id: detect
uses: dorny/paths-filter@fbd0ab8f3e69293af611ebaee6363fc25e6d187d # v4.0.1
with:
predicate-quantifier: 'every'
filters: |
code:
- '**'
- '!**/*.md'
- '!**/*.txt'
- '!**/*.html'
- '!docs/**'
- '!website/**'
- '!LICENSE'
- '!.gitignore'
examples:
needs: changes
if: needs.changes.outputs.code == 'true'
runs-on: ubuntu-latest
timeout-minutes: 45
steps:
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
- uses: dtolnay/rust-toolchain@29eef336d9b2848a0b548edc03f92a220660cdb8 # stable
- uses: Swatinem/rust-cache@e18b497796c12c097a38f9edb9d0641fb99eee32 # v2
- name: Build server
run: cargo build --bin fakecloud
- name: Start FakeCloud
run: |
cargo run --bin fakecloud &
for i in $(seq 1 30); do
curl -sf http://localhost:4566/_fakecloud/health && exit 0
sleep 1
done
echo "FakeCloud failed to start"
exit 1
- uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
with:
python-version: "3.12"
- uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
with:
node-version: "20"
- name: Run Python demo
run: |
pip install boto3
python examples/python/demo.py
- name: Run Node demo
run: |
for i in 1 2 3; do
npm install @aws-sdk/client-sqs @aws-sdk/client-sns @aws-sdk/client-ssm @aws-sdk/client-s3 @aws-sdk/client-dynamodb @aws-sdk/client-lambda @aws-sdk/client-secrets-manager @aws-sdk/client-cloudwatch-logs @aws-sdk/client-kms && ok=1 && break
echo "npm install attempt $i failed; retrying"; sleep $((i * 5))
done
[ "${ok:-}" = 1 ] || { echo "npm install failed after 3 attempts"; exit 1; }
node examples/node/demo.js
- name: Run sample app
run: python examples/sample-app/app.py
- uses: hashicorp/setup-terraform@dfe3c3f87815947d99a8997f908cb6525fc44e9e # v4.0.1
- name: Run Terraform example
working-directory: examples/terraform
run: |
rm -rf .terraform .terraform.lock.hcl terraform.tfstate*
terraform init
terraform apply -auto-approve
terraform destroy -auto-approve