-
Notifications
You must be signed in to change notification settings - Fork 180
188 lines (172 loc) · 6.49 KB
/
integration.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
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
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
name: Integration tests
# We use environments to require approval to run integration tests on PRs, but not on pushes to
# `main` (which have been approved already since PRs are required for `main`).
on:
workflow_call:
inputs:
environment:
type: string
ref:
required: true
type: string
env:
RUST_BACKTRACE: 1
CARGO_TERM_COLOR: always
CARGO_INCREMENTAL: 0
S3_BUCKET_NAME: ${{ vars.S3_BUCKET_NAME }}
S3_EXPRESS_ONE_ZONE_BUCKET_NAME: ${{ vars.S3_EXPRESS_ONE_ZONE_BUCKET_NAME }}
# Optional endpoint urls, can be empty
S3_ENDPOINT_URL: ${{ vars.S3_ENDPOINT_URL }}
S3_EXPRESS_ONE_ZONE_ENDPOINT_URL: ${{ vars.S3_EXPRESS_ONE_ZONE_ENDPOINT_URL }}
S3_REGION: ${{ vars.S3_REGION }}
S3_BUCKET_TEST_PREFIX: ${{ vars.S3_BUCKET_TEST_PREFIX || 'github-actions-tmp/' }}run-${{ github.run_id }}/attempt-${{ github.run_attempt }}/
# A bucket our IAM role has no access to, but is in the right region, for permissions tests
S3_FORBIDDEN_BUCKET_NAME: ${{ vars.S3_FORBIDDEN_BUCKET_NAME }}
# An IAM role that tests can assume when they want to create session policies
S3_SUBSESSION_IAM_ROLE: ${{ vars.S3_SUBSESSION_IAM_ROLE }}
# Different Access Points Aliases and ARNs
S3_ACCESS_POINT_ALIAS: ${{ vars.S3_ACCESS_POINT_ALIAS }}
S3_ACCESS_POINT_ARN: ${{ vars.S3_ACCESS_POINT_ARN }}
S3_OLAP_ALIAS: ${{ vars.S3_OLAP_ALIAS }}
S3_OLAP_ARN: ${{ vars.S3_OLAP_ARN }}
S3_MRAP_ARN: ${{ vars.S3_MRAP_ARN }}
KMS_TEST_KEY_ID: ${{ vars.KMS_TEST_KEY_ID }}
RUST_FEATURES: fuse_tests,s3_tests,fips_tests,event_log
permissions:
id-token: write
contents: read
jobs:
test:
name: Tests (${{ matrix.runner.name }}, FUSE ${{ matrix.fuseVersion }})
runs-on: ${{ matrix.runner.tags }}
environment: ${{ inputs.environment }}
strategy:
fail-fast: false
matrix:
fuseVersion: [2, 3]
runner:
- name: Ubuntu x86
tags: [ubuntu-22.04] # GitHub-hosted
- name: Amazon Linux arm
tags: [self-hosted, linux, arm64]
exclude:
# fuse3 is not available on Amazon Linux 2
- runner:
name: Amazon Linux arm
tags: [self-hosted, linux, arm64]
fuseVersion: 3
steps:
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: ${{ vars.ACTIONS_IAM_ROLE }}
aws-region: ${{ vars.S3_REGION }}
- name: Checkout code
uses: actions/checkout@v4
with:
ref: ${{ inputs.ref }}
submodules: true
persist-credentials: false
- name: Set up Rust toolchain
uses: actions-rust-lang/setup-rust-toolchain@v1
with:
# setup-rust-toolchain sets "-D warnings" by default, and Rust treats any warning as compile error.
# We need to this currently because `vendor/fuser` contains some warnings and it breaks the build.
rustflags: ""
- name: Install operating system dependencies
uses: ./.github/actions/install-dependencies
with:
fuseVersion: ${{ matrix.fuseVersion }}
- name: Build tests
run: cargo test --features $RUST_FEATURES --no-run
- name: Run tests
run: cargo test --features $RUST_FEATURES
- name: Save dump files
if: ${{ failure() && matrix.runner.name == 'Amazon Linux arm' }}
run: ./.github/actions/scripts/save-coredump.sh
s3express-test:
name: S3 Express One Zone tests (${{ matrix.runner.name }}, FUSE ${{ matrix.fuseVersion }})
runs-on: ${{ matrix.runner.tags }}
environment: ${{ inputs.environment }}
strategy:
fail-fast: false
matrix:
fuseVersion: [2, 3]
runner:
- name: Ubuntu x86
tags: [ubuntu-22.04] # GitHub-hosted
- name: Amazon Linux arm
tags: [self-hosted, linux, arm64]
exclude:
# fuse3 is not available on Amazon Linux 2
- runner:
name: Amazon Linux arm
tags: [self-hosted, linux, arm64]
fuseVersion: 3
steps:
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: ${{ vars.ACTIONS_IAM_ROLE }}
aws-region: ${{ vars.S3_REGION }}
- name: Checkout code
uses: actions/checkout@v4
with:
ref: ${{ inputs.ref }}
submodules: true
persist-credentials: false
- name: Set up Rust toolchain
uses: actions-rust-lang/setup-rust-toolchain@v1
with:
# setup-rust-toolchain sets "-D warnings" by default, and Rust treats any warning as compile error.
# We need to this currently because `vendor/fuser` contains some warnings and it breaks the build.
rustflags: ""
- name: Install operating system dependencies
uses: ./.github/actions/install-dependencies
with:
fuseVersion: ${{ matrix.fuseVersion }}
- name: Build tests
run: cargo test --features '${{ env.RUST_FEATURES }},s3express_tests' --no-run
- name: Run tests
run: cargo test --features '${{ env.RUST_FEATURES }},s3express_tests'
- name: Save dump files
if: ${{ failure() && matrix.runner.name == 'Amazon Linux arm' }}
run: ./.github/actions/scripts/save-coredump.sh
asan:
name: Address sanitizer
runs-on: [self-hosted, linux, arm64]
environment: ${{ inputs.environment }}
env:
# We're using ASan to test our CRT bindings, so focus only on S3, not on FUSE
RUST_FEATURES: s3_tests,fips_tests
timeout-minutes: 30
steps:
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: ${{ vars.ACTIONS_IAM_ROLE }}
aws-region: ${{ vars.S3_REGION }}
- name: Checkout code
uses: actions/checkout@v4
with:
ref: ${{ inputs.ref }}
submodules: true
- name: Set up Rust toolchain
uses: actions-rust-lang/setup-rust-toolchain@v1
with:
# setup-rust-toolchain sets "-D warnings" by default, and Rust treats any warning as compile error.
# We need to this currently because `vendor/fuser` contains some warnings and it breaks the build.
rustflags: ""
components: rust-src
- name: Install operating system dependencies
uses: ./.github/actions/install-dependencies
with:
fuseVersion: 3
llvm: true
- name: Validate ASan is working
run: make test-asan-working
- name: Run tests
run: make test-asan
- name: Save dump files
if: ${{ failure() }}
run: ./.github/actions/scripts/save-coredump.sh