Debian Codegraph @

.github/actions/test_artifacts/action.yml

raw
1 name: "test_artifacts"
2 description: "Upload failed test artifacts"
3 runs:
4 using: "composite"
5 steps:
6 - name: Collect matrix properties for naming
7 uses: actions/github-script@v9
8 id: matrix-props
9 env:
10 MATRIX_PROPS: ${{ toJSON(matrix) }}
11 with:
12 # An array-flattening-to-string JavaScript function.
13 script: |
14 const f = function (x) { return x.toString().length > 0; }
15 const g = function (x) {
16 return (Array.isArray(x))
17 ? x.filter(f)
18 .map((function (h) { return function (y) { return h(y); }; })(g))
19 .join('-')
20 : x;
21 }
22 return Object.values(JSON.parse(process.env.MATRIX_PROPS))
23 .filter(f)
24 .map(g)
25 .join('-');
26 # By default, the JSON-encoded return value of the function is
27 # set as the "result".
28 result-encoding: string
29 - name: Upload failed tests
30 uses: actions/upload-artifact@v7
31 with:
32 # Name of the artifact to upload.
33 name: ${{ format('GH-{0}-{1}-{2}-{3}-{4}-failed-tests',
34 github.run_id,
35 github.run_attempt,
36 github.job,
37 strategy.job-index,
38 steps.matrix-props.outputs.result) }}
39
40 # A file, directory or wildcard pattern that describes what
41 # to upload.
42 path: |
43 ${{ github.workspace }}/logs/**/*.symbolized
44 ${{ github.workspace }}/runtime/indent/testdir/*.fail
45 ${{ github.workspace }}/runtime/syntax/testdir/failed/*
46 ${{ github.workspace }}/src/testdir/failed/*
47 # The desired behavior if no files are found using the
48 # provided path.
49 if-no-files-found: ignore
50
51 # Duration after which artifact will expire in days. 0 means
52 # using repository settings.
53 retention-days: 0
54
55 # If true, an artifact with a matching name will be deleted
56 overwrite: true