Merge pull request #226 from yut23/pull-no-tag #124
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
name: Lint & test | |
on: | |
push: | |
branches: [ '*' ] | |
pull_request: | |
branches: [ '*' ] | |
jobs: | |
lint: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Install shellcheck | |
run: | | |
wget -O- https://github.com/koalaman/shellcheck/releases/download/v0.7.1/shellcheck-v0.7.1.linux.x86_64.tar.xz | \ | |
sudo tar -xJC /usr/local/bin --strip-components 1 shellcheck-v0.7.1/shellcheck | |
- name: Checkout the project | |
uses: actions/checkout@v4 | |
- name: Lint with shellcheck | |
run: | | |
echo "::add-matcher::.github/shellcheck.json" | |
test/shellcheck | |
echo "::remove-matcher owner=shellcheck::" | |
test: | |
strategy: | |
matrix: | |
bash-version: ['3.2.57', '4.0', '4.1', '4.2', '4.3', '4.3.30', '4.4', '5.0', '5.1', '5.1.12', '5.1.16', '5.2', '5.2.9'] | |
runs-on: ubuntu-latest | |
steps: | |
- name: Install testing dependencies | |
run: | | |
sudo apt-add-repository ppa:fish-shell/release-3 --yes | |
sudo apt-get -qq update | |
sudo apt-get -qq install fish expect tcsh | |
git clone --depth 1 --branch v1.2.1 https://github.com/bats-core/bats-core.git /tmp/bats | |
sudo /tmp/bats/install.sh /usr/local | |
rm -rf /tmp/bats | |
- name: Checkout the project | |
uses: actions/checkout@v4 | |
- name: Cache bash versions | |
uses: actions/cache@v4 | |
env: | |
cache-name: bash-version | |
with: | |
path: test/bash-versions/bash-${{ matrix.bash-version }}/bash | |
key: ${{ env.cache-name }}-${{ matrix.bash-version }} | |
- name: Download & compile bash ${{ matrix.bash-version }} | |
run: | | |
test/get_bash.sh "${{ matrix.bash-version }}" | |
echo "$PWD/test/bash-versions/bash-${{ matrix.bash-version }}" >> "$GITHUB_PATH" | |
- name: Download bats libraries | |
run: test/get_bats_libs.sh | |
- name: Test | |
run: | | |
echo "::add-matcher::.github/bats.json" | |
/usr/local/bin/bats --tap "$PWD/test/suites" | |
echo "::remove-matcher owner=bats::" |