rebased #2102: add bashcov tests #3600
Workflow file for this run
This file contains hidden or 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: CI | |
# Triggers the workflow on push or pull request events | |
on: [push, pull_request] | |
jobs: | |
bats-test: | |
strategy: | |
matrix: | |
os: [ubuntu-24.04, macos-14] | |
runs-on: ${{ matrix.os }} | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install greadlink | |
if: startsWith(runner.os, 'macOS') | |
run: brew install coreutils | |
- name: Install parallel | |
if: startsWith(runner.os, 'macOS') | |
run: brew install parallel | |
- name: Test code | |
run: test/run | |
code-coverage: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: ruby/[email protected] | |
with: | |
ruby-version: '2.7' | |
- name: Install Ruby dependencies | |
run: bundle update --bundler && bundle install | |
- name: Run tests | |
run: bashcov test/run | |
- name: Upload reports to Codecov | |
run: | | |
curl -Os https://uploader.codecov.io/latest/linux/codecov | |
chmod +x codecov | |
./codecov -f coverage/codecov-result.json -Z | |
build-docs: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: 3.8 | |
- name: Install docs dependencies | |
run: python3 -m pip install -r docs/requirements.txt | |
- name: Build the docs | |
run: sphinx-build -W -b html docs docs/_build/html | |
lint: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Go | |
uses: actions/setup-go@v4 | |
with: | |
go-version: 1.21.0 | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: 3.8 | |
- name: Install shfmt | |
run: go install mvdan.cc/sh/v3/cmd/shfmt@latest | |
- name: Install shellcheck | |
env: | |
scversion: stable # Or latest, vxx, etc | |
run: | | |
wget -qO- "https://github.com/koalaman/shellcheck/releases/download/${scversion?}/shellcheck-${scversion?}.linux.x86_64.tar.xz" | tar -xJv "shellcheck-${scversion}/shellcheck" | |
sudo cp "shellcheck-${scversion}/shellcheck" /usr/bin/ | |
shellcheck --version | |
- name: Install pre-commit | |
run: python3 -m pip install -r test/lint-requirements.txt | |
- name: Run lint | |
run: ./lint_clean_files.sh | |
lint-differential: | |
runs-on: ubuntu-latest | |
permissions: | |
security-events: write | |
steps: | |
- name: Repository checkout | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- id: ShellCheck | |
name: Differential ShellCheck | |
uses: redhat-plumbers-in-action/differential-shellcheck@v5 | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} |