Skip to content
Open
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
43 changes: 40 additions & 3 deletions .github/workflows/verify.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,45 @@ jobs:

runs-on: ubuntu-latest

name: verify (node ${{ matrix.node-version }}, ${{ matrix.shfmt }} shfmt)

strategy:
fail-fast: false
matrix:
node-version: [20.x, 22.x]
shfmt: [distro]
include:
# shfmt occasionally changes its output and its error messages, which
# the formatter tests assert on. The archive version lags well behind,
# so run one job against the latest release to catch such changes when
# they happen rather than when a user reports them.
- node-version: 22.x
shfmt: latest

steps:
- uses: actions/checkout@v4

- name: Install shellcheck and shfmt (used for testing)
run: sudo apt-get install -y shellcheck shfmt
- name: Install shellcheck (used for testing)
run: sudo apt-get install -y shellcheck

- name: Install shfmt from the Ubuntu archive (used for testing)
if: matrix.shfmt == 'distro'
run: sudo apt-get install -y shfmt

- name: Install the latest shfmt release (used for testing)
if: matrix.shfmt == 'latest'
env:
GH_TOKEN: ${{ github.token }}
run: |
tag=$(gh release view --repo mvdan/sh --json tagName --jq .tagName)
sudo curl -fsSL -o /usr/local/bin/shfmt \
"https://github.com/mvdan/sh/releases/download/$tag/shfmt_${tag}_linux_amd64"
sudo chmod +x /usr/local/bin/shfmt

- name: Show which shfmt is used
run: |
command -v shfmt
shfmt --version

- uses: pnpm/action-setup@v4
with:
Expand All @@ -34,7 +64,14 @@ jobs:

- name: Publish coverage to codecov.io
uses: codecov/codecov-action@v5
if: success() && matrix.node-version == '22.x'
if: success() && matrix.node-version == '22.x' && matrix.shfmt == 'distro'
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: ./codecov.yml

all-done:
needs:
- verify
runs-on: ubuntu-latest
steps:
- run: echo "All jobs completed"
Loading