Repository navigation
89 lines (83 loc) · 3.23 KB
/
Copy path_rust.yml
File metadata and controls
89 lines (83 loc) · 3.23 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
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
name: _rust
on:
workflow_call:
inputs:
plan:
description: "JSON with checks (component/task entries)"
type: string
required: true
permissions:
contents: read
issues: read # live breaking:storage label lookup
jobs:
checks:
name: ${{ matrix.task }}
if: ${{ fromJSON(inputs.plan).checks[0] != null }}
strategy:
fail-fast: true
matrix:
include: ${{ fromJSON(inputs.plan).checks }}
runs-on: ${{
(matrix.task == 'build-aarch64-gnu' || matrix.task == 'build-aarch64-musl') && 'ubuntu-26.04-arm' ||
(matrix.task == 'build-macos-aarch64' || matrix.task == 'clippy-macos-aarch64') && 'macos-14' ||
matrix.task == 'build-windows-sdk' && 'windows-latest' ||
'ubuntu-26.04'
}}
timeout-minutes: 60
steps:
- uses: actions/checkout@v7.0.1
# Re-runs replay the original event labels. Read live labels so applying
# breaking:storage followed by a re-run can skip an intentional format break.
- name: Resolve breaking:storage escape hatch
id: storage_hatch
if: matrix.task == 'test-storage-compat' && github.event.pull_request.number
uses: actions/github-script@v9
with:
script: |
let skip = false;
try {
const labels = await github.paginate(
github.rest.issues.listLabelsOnIssue,
{
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.payload.pull_request.number,
per_page: 100,
},
);
skip = labels.some(l => l.name === 'breaking:storage');
} catch (e) {
core.warning(`listLabelsOnIssue failed (${e.status ?? e.code ?? 'network'}), running the check`);
}
core.info(`breaking:storage escape hatch: skip=${skip}`);
core.setOutput('skip', String(skip));
- name: Run Rust check
if: steps.storage_hatch.outputs.skip != 'true'
uses: ./.github/actions/rust/pre-merge
with:
task: ${{ matrix.task }}
component: ${{ matrix.component }}
- name: Upload reports
if: always()
uses: actions/upload-artifact@v7
with:
name: ${{ matrix.component }}-${{ matrix.task }}-reports-${{ github.run_id }}-${{ github.run_attempt }}
path: reports/**
if-no-files-found: ignore
retention-days: 7