Skip to content

Use an array for extraDiffArgs #53

Use an array for extraDiffArgs

Use an array for extraDiffArgs #53

Workflow file for this run

# SPDX-FileCopyrightText: 2022-2024 Paul Colby <git@colby.id.au>
# SPDX-License-Identifier: MIT
name: Automatic Tests
on: [push, pull_request]
jobs:
test-gawk:
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- name: Setup macOS
if: startsWith(matrix.os, 'macos')
run: brew install gawk
- name: Run tests
run: ./test/test.sh
shell: bash
strategy:
matrix:
os:
- macos-11
- macos-12
- macos-13
- ubuntu-20.04
- ubuntu-22.04
- windows-2019
- windows-2022
fail-fast: false
test-gh-action:
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- name: Setup macOS
if: startsWith(matrix.os, 'macos')
run: brew install gawk
- name: Setup Windows
if: startsWith(matrix.os, 'windows')
run: echo 'EXTRA_DIFF_ARGS=--strip-trailing-cr' >> "$GITHUB_ENV"
shell: bash
- name: Reset step summary
run: '> "$GITHUB_STEP_SUMMARY"'
shell: bash
- name: Run default action
if: ${{ !startsWith(matrix.os, 'macos') }}
uses: ./
id: default
- name: Check result
if: ${{ !startsWith(matrix.os, 'macos') }}
run: diff ${EXTRA_DIFF_ARGS:-} --unified ./.github/workflows/expected/default.md "$SUMMARY_FILE"
shell: bash
env:
SUMMARY_FILE: ${{ steps.default.outputs.summary-file }}
- name: Reset step summary
run: '> "$GITHUB_STEP_SUMMARY"'
shell: bash
- name: Test path input
uses: ./
with:
path: >-
./test/qtpokit-2554496971/test-results-linux-clang/test/unit/*.tap
./test/qtpokit-2554496971/test-results-linux-gcc/test/unit/*.tap
id: path
- name: Check result
run: diff ${EXTRA_DIFF_ARGS:-} --unified ./.github/workflows/expected/path.md "$SUMMARY_FILE"
shell: bash
env:
SUMMARY_FILE: ${{ steps.path.outputs.summary-file }}
- name: Reset step summary
run: '> "$GITHUB_STEP_SUMMARY"'
shell: bash
- name: Test summary-file input
uses: ./
with:
path: >-
./test/qtpokit-2554496971/test-results-linux-clang/test/unit/*.tap
./test/qtpokit-2554496971/test-results-linux-gcc/test/unit/*.tap
summary-file: ${{ runner.temp }}/summary.md
- name: Check result
run: >-
diff ${EXTRA_DIFF_ARGS:-} --unified ./.github/workflows/expected/path.md "$RUNNER_TEMP/summary.md"
shell: bash
strategy:
matrix:
os:
- macos-11
- macos-12
- macos-13
- ubuntu-20.04
- ubuntu-22.04
- windows-2019
- windows-2022
fail-fast: false