fix(deps): bump actions/checkout from 3 to 4 #72
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# SPDX-FileCopyrightText: © Vegard IT GmbH (https://vegardit.com) and contributors | |
# SPDX-FileContributor: Sebastian Thomschke, Vegard IT GmbH | |
# SPDX-License-Identifier: Apache-2.0 | |
# | |
# https://docs.github.com/en/free-pro-team@latest/actions/reference/workflow-syntax-for-github-actions | |
name: Build | |
on: | |
push: | |
branches: | |
- '**' | |
tags-ignore: | |
- '**' | |
paths-ignore: | |
- '**/*.md' | |
- '.github/*.yml' | |
- '.semaphore/**/*' | |
pull_request: | |
workflow_dispatch: | |
# https://github.blog/changelog/2020-07-06-github-actions-manual-triggers-with-workflow_dispatch/ | |
inputs: | |
debug-with-ssh: | |
description: "Start an SSH session for debugging purposes after tests finished:" | |
default: never | |
type: choice | |
options: [ always, on_failure, on_failure_or_cancelled, never ] | |
debug-with-ssh-only-for-actor: | |
description: "Limit access to the SSH session to the GitHub user that triggered the job." | |
default: true | |
type: boolean | |
debug-with-ssh-only-jobs-matching: | |
description: "Only start an SSH session for jobs matching this regex pattern:" | |
default: ".*" | |
type: string | |
defaults: | |
run: | |
shell: bash | |
jobs: | |
shellcheck: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Git Checkout | |
uses: actions/checkout@v4 #https://github.com/actions/checkout | |
- name: Run shellcheck | |
run: bash tests/run-shellcheck.sh | |
test: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [ "ubuntu-20.04", "ubuntu-22.04" ] | |
test_shell: [ "ash" , "bash", "busybox", "dash", "ksh", "zsh" ] | |
include: | |
- { os: macos-11, test_shell: bash } | |
- { os: macos-11, test_shell: ksh } | |
- { os: macos-11, test_shell: zsh } | |
- { os: macos-12, test_shell: bash } | |
- { os: macos-12, test_shell: ksh } | |
- { os: macos-12, test_shell: zsh } | |
steps: | |
- name: Git Checkout | |
uses: actions/checkout@v4 #https://github.com/actions/checkout | |
- name: Install ${{ matrix.test_shell }} | |
run: | | |
if [[ "$OSTYPE" == "darwin"* ]]; then | |
brew install bash parallel ${{ matrix.test_shell }} | |
else | |
sudo apt-get install -y bash parallel ${{ matrix.test_shell }} | |
fi | |
- name: Test with ${{ matrix.test_shell }} | |
continue-on-error: ${{ runner.os == 'macOS' }} # too many random hangs | |
timeout-minutes: 2 | |
run: | | |
bash tests/run-tests.sh ${{ matrix.test_shell }} | |
- name: "SSH session for debugging: check" | |
id: debug_ssh_sesssion_check | |
if: always() | |
run: | | |
set -eu | |
job_filter_pattern="${{ inputs.debug-with-ssh-only-jobs-matching }}" | |
echo "job_filter: $job_filter_pattern" | |
job_info=$(echo "$GITHUB_JOB ${{ toJSON(matrix) }}" | tr -d '\n') | |
echo "job_info: $job_info" | |
if [[ "$job_info" =~ .*$job_filter_pattern.* ]] && case "${{ job.status }}" in | |
success) [[ "${{ inputs.debug-with-ssh }}" == always ]] ;; | |
cancelled) [[ "${{ inputs.debug-with-ssh }}" == on_failure_or_cancelled ]] ;; | |
failure) [[ "${{ inputs.debug-with-ssh }}" =~ on_failure.* ]] ;; | |
esac; then | |
echo "start_session=true" >>$GITHUB_OUTPUT; | |
fi | |
- name: "SSH session for debugging: start" | |
uses: mxschmitt/action-tmate@v3 # https://github.com/mxschmitt/action-tmate | |
if: always() && steps.debug_ssh_sesssion_check.outputs.start_session | |
with: | |
limit-access-to-actor: ${{ inputs.debug-with-ssh-only-for-actor }} |