Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
58 changes: 34 additions & 24 deletions .github/actions/test_artifacts/action.yml
Original file line number Diff line number Diff line change
@@ -1,31 +1,41 @@
name: 'test_artifacts'
description: "Upload failed test artifacts"
inputs:
artifact-name:
description: Name of the artifact
required: true

runs:
using: "composite"
steps:
- name: Collect matrix properties for naming
uses: actions/github-script@v8
id: matrix-props
env:
MATRIX_PROPS: ${{ toJSON(matrix) }}
with:
# An array-flattening-to-string JavaScript function.
script: |
const f = function (x) { return x.toString().length > 0; }
const g = function (x) {
return (Array.isArray(x))
? x.filter(f)
.map((function (h) { return function (y) { return h(y); }; })(g))
.join('-')
: x;
}
return Object.values(JSON.parse(process.env.MATRIX_PROPS))
.filter(f)
.map(g)
.join('-');
# By default, the JSON-encoded return value of the function is
# set as the "result".
result-encoding: string
# MacVim: We don't use a matrix within the reused
# workflow, and so would prefer to manually pass
# in the name of the artifact rather than deriving
# it from the matrix automatically like in Vim
# upstream.
# - name: Collect matrix properties for naming
# uses: actions/github-script@v8
# id: matrix-props
# env:
# MATRIX_PROPS: ${{ toJSON(inputs) }}
# with:
# # An array-flattening-to-string JavaScript function.
# script: |
# const f = function (x) { return x.toString().length > 0; }
# const g = function (x) {
# return (Array.isArray(x))
# ? x.filter(f)
# .map((function (h) { return function (y) { return h(y); }; })(g))
# .join('-')
# : x;
# }
# return Object.values(JSON.parse(process.env.MATRIX_PROPS))
# .filter(f)
# .map(g)
# .join('-');
# # By default, the JSON-encoded return value of the function is
# # set as the "result".
# result-encoding: string
- name: Upload failed tests
uses: actions/upload-artifact@v4
with:
Expand All @@ -35,7 +45,7 @@ runs:
github.run_attempt,
github.job,
strategy.job-index,
steps.matrix-props.outputs.result) }}
inputs.artifact-name) }}

# A file, directory or wildcard pattern that describes what
# to upload.
Expand Down
15 changes: 14 additions & 1 deletion .github/actions/test_macvim_artifacts/action.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,27 @@
# This is a clone of test_artifacts for MacVim-specific files
# This should be almost identical to test_artifacts, other than the artifact
# name/path. In the future we could potentially combine the two, but for now
# it's simpler to keep them separate to ease upstream merging.
name: 'test_macvim_artifacts'
description: "Upload failed MacVim test artifacts"
inputs:
artifact-name:
description: Name of the artifact
required: true

runs:
using: "composite"
steps:
- name: Upload failed tests
uses: actions/upload-artifact@v4
with:
# Name of the artifact to upload.
name: ${{ github.workflow }}-${{ github.job }}-${{ join(matrix.*, '-') }}-failed-macvim-tests
name: ${{ format('GH-{0}-{1}-{2}-{3}-{4}-failed-macvim-tests',
github.run_id,
github.run_attempt,
github.job,
strategy.job-index,
inputs.artifact-name) }}

# A file, directory or wildcard pattern that describes what
# to upload.
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/macvim-buildtest.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -353,6 +353,8 @@ jobs:
- name: Upload failed MacVim test results
if: ${{ !cancelled() && failure() && steps.test_macvim.conclusion == 'failure' }}
uses: ./.github/actions/test_macvim_artifacts
with:
artifact-name: ${{ format('{0}-{1}', inputs.os, inputs.xcode) }}

- name: Build Vim test binaries
run: |
Expand Down Expand Up @@ -385,6 +387,8 @@ jobs:
- name: Upload failed test files
if: ${{ !cancelled() && failure() }}
uses: ./.github/actions/test_artifacts
with:
artifact-name: ${{ format('{0}-{1}', inputs.os, inputs.xcode) }}

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