2023-10-13 14:40:13 +00:00
|
|
|
# reusable workflow
|
|
|
|
name: .test-prepare
|
|
|
|
|
|
|
|
# TODO: hide reusable workflow from the UI. Tracked in https://github.com/community/community/discussions/12025
|
|
|
|
|
|
|
|
on:
|
|
|
|
workflow_call:
|
|
|
|
outputs:
|
|
|
|
matrix:
|
|
|
|
description: Test matrix
|
|
|
|
value: ${{ jobs.run.outputs.matrix }}
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
run:
|
|
|
|
runs-on: ubuntu-20.04
|
|
|
|
outputs:
|
|
|
|
matrix: ${{ steps.set.outputs.matrix }}
|
|
|
|
steps:
|
|
|
|
-
|
|
|
|
name: Checkout
|
2024-01-30 12:28:43 +00:00
|
|
|
uses: actions/checkout@v4
|
2023-10-13 14:40:13 +00:00
|
|
|
-
|
|
|
|
name: Create matrix
|
|
|
|
id: set
|
2024-01-30 12:31:56 +00:00
|
|
|
uses: actions/github-script@v7
|
2023-10-13 14:40:13 +00:00
|
|
|
with:
|
|
|
|
script: |
|
|
|
|
let matrix = ['graphdriver'];
|
|
|
|
if ("${{ contains(github.event.pull_request.labels.*.name, 'containerd-integration') || github.event_name != 'pull_request' }}" == "true") {
|
|
|
|
matrix.push('snapshotter');
|
|
|
|
}
|
|
|
|
await core.group(`Set matrix`, async () => {
|
|
|
|
core.info(`matrix: ${JSON.stringify(matrix)}`);
|
|
|
|
core.setOutput('matrix', JSON.stringify(matrix));
|
|
|
|
});
|