Skip to content

Commit 747a6ca

Browse files
committed
Proper inputs
1 parent f577396 commit 747a6ca

2 files changed

Lines changed: 37 additions & 24 deletions

File tree

.github/actions/test_artifacts/action.yml

Lines changed: 35 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,42 @@
11
name: 'test_artifacts'
22
description: "Upload failed test artifacts"
3+
inputs:
4+
artifact-name:
5+
description: Name of the artifact
6+
required: true
7+
38
runs:
49
using: "composite"
510
steps:
6-
- name: Collect matrix properties for naming
7-
uses: actions/github-script@v8
8-
id: matrix-props
9-
env:
10-
MATRIX_PROPS: ${{ toJSON(inputs) }}
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
11+
# MacVim: We don't use a matrix within the reused
12+
# workflow, and so would prefer to manually pass
13+
# in the name of the artifact rather than deriving
14+
# it from the matrix automatically like in Vim
15+
# upstream.
16+
17+
# - name: Collect matrix properties for naming
18+
# uses: actions/github-script@v8
19+
# id: matrix-props
20+
# env:
21+
# MATRIX_PROPS: ${{ toJSON(inputs) }}
22+
# with:
23+
# # An array-flattening-to-string JavaScript function.
24+
# script: |
25+
# const f = function (x) { return x.toString().length > 0; }
26+
# const g = function (x) {
27+
# return (Array.isArray(x))
28+
# ? x.filter(f)
29+
# .map((function (h) { return function (y) { return h(y); }; })(g))
30+
# .join('-')
31+
# : x;
32+
# }
33+
# return Object.values(JSON.parse(process.env.MATRIX_PROPS))
34+
# .filter(f)
35+
# .map(g)
36+
# .join('-');
37+
# # By default, the JSON-encoded return value of the function is
38+
# # set as the "result".
39+
# result-encoding: string
2940
- name: Upload failed tests
3041
uses: actions/upload-artifact@v4
3142
with:
@@ -35,7 +46,7 @@ runs:
3546
github.run_attempt,
3647
github.job,
3748
strategy.job-index,
38-
inputs.os) }}
49+
inputs.artifact-name) }}
3950

4051
# A file, directory or wildcard pattern that describes what
4152
# to upload.

.github/workflows/macvim-buildtest.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -385,6 +385,8 @@ jobs:
385385
- name: Upload failed test files
386386
#if: ${{ !cancelled() && failure() }}
387387
uses: ./.github/actions/test_artifacts
388+
with:
389+
artifact-name: ${{ inputs.os }}
388390

389391
- name: Build MacVim dmg image
390392
if: inputs.publish && (startsWith(github.ref, 'refs/tags/') || github.ref == 'refs/heads/master')

0 commit comments

Comments
 (0)