[codex] add CI workflow lint and whitespace checks #22
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 | |
| on: | |
| pull_request: | |
| push: | |
| branches: | |
| - main | |
| jobs: | |
| actionlint: | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 10 | |
| permissions: | |
| contents: read | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v6 | |
| - name: Actionlint | |
| uses: docker://rhysd/actionlint:1.7.12 | |
| test: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v6 | |
| with: | |
| fetch-depth: 0 | |
| - name: Check whitespace | |
| run: | | |
| set -euo pipefail | |
| if [ "${{ github.event_name }}" = "pull_request" ]; then | |
| git fetch --no-tags --depth=1 origin "${{ github.base_ref }}" | |
| git diff --check "origin/${{ github.base_ref }}...HEAD" | |
| else | |
| git diff-tree --check --no-commit-id --root -r HEAD | |
| fi | |
| - name: Set up Python | |
| uses: actions/setup-python@v6 | |
| with: | |
| python-version: "3.11" | |
| - name: Install package and test dependencies | |
| run: | | |
| set -euo pipefail | |
| python -m pip install --upgrade pip | |
| python -m pip install -e . pytest ruff build | |
| - name: Verify dependencies | |
| run: python -m pip check | |
| - name: Ruff | |
| run: ruff check . | |
| - name: Run tests | |
| run: python -m pytest tests -q | |
| - name: Build package | |
| run: python -m build |