Skip to content

Test

Test #24

Workflow file for this run

name: Test
on:
# push:
pull_request:
workflow_dispatch:
defaults:
run:
shell: bash
env:
PYTHON_VERSION: "3.11.9"
jobs:
test:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [windows-2022, macos-12, macos-14, ubuntu-20.04]
steps:
- name: <Setup> Check out the repository
uses: actions/checkout@v4
- name: <Setup> Install Poetry
run: python -m pip install poetry
- name: <Setup> Set up Python
uses: actions/setup-python@v5
with:
python-version: ${{ env.PYTHON_VERSION }}
cache: poetry
- name: <Setup> Install Python dependencies
run: poetry install --with=test
- name: <Test> Validate poetry.lock
run: |
poetry lock --no-update
git diff --exit-code
- name: <Test> Check format
run: PYTHONUTF8=1 poetry run task lint
- name: <Test> Test codes and coverage
run: poetry run coverage run --omit=test/* -m pytest
- name: <Deploy> Submit coverage results to Coveralls
if: matrix.os == 'ubuntu-20.04'
run: poetry run coveralls --service=github
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: <Test> Check licenses
run: poetry run task update-licenses
- name: <Test> Test names by checking typo
if: matrix.os == 'ubuntu-20.04'
uses: crate-ci/[email protected]
lint-builders:
runs-on: ubuntu-20.04
steps:
- name: <Setup> Check out the repository
uses: actions/checkout@v4
- name: <Setup> Install ShellCheck
run: |
sudo apt-get update
sudo apt-get install -y shellcheck
- name: <Test> Check shell files
run: git ls-files | grep -E '\.(ba)?sh' | xargs shellcheck
- name: <Test> Check workflow files
run: |
bash <(curl https://raw.githubusercontent.com/rhysd/actionlint/main/scripts/download-actionlint.bash)
./actionlint