Skip to content

test: add tests

test: add tests #129

Workflow file for this run

name: CI
on:
pull_request:
branches:
- main
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
defaults:
run:
shell: bash -el {0}
jobs:
test:
name: Run Tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: Setup BATS
uses: bats-core/bats-action@3.0.0
- name: Run BATS tests
run: bats --jobs 4 --timing tests/*.bats
run-ci:
name: Run CI
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: actions/setup-python@v6
with:
check-latest: true
cache: "pip"
- name: Install pre-commit
run: |
python3 -m pip install --upgrade pip
python3 -m pip install --upgrade pre-commit
- name: Set cache date
run: |
echo "DATE=$(date +'%Y%m%d')" >> "$GITHUB_ENV"
- name: Cache pre-commit hooks
id: cache-pre-commit-hooks
uses: actions/cache@v5
env:
CACHE_NUMBER: 0
with:
path: ~/.cache/pre-commit
key: ${{ runner.os }}-precommit-${{ hashFiles('.pre-commit-config.yaml') }}-${{ env.DATE }}-${{ env.CACHE_NUMBER }} # yamllint disable-line rule:line-length
- name: Install pre-commit hooks
if: steps.cache-pre-commit-hooks.outputs.cache-hit != 'true'
run: |
pre-commit install
- name: Run pre-commit hooks
run: |
pre-commit run --all-files