Tracebit Canary onboarding #4
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: 'Syntax check and test' | |
| on: | |
| pull_request: | |
| push: | |
| permissions: | |
| contents: read | |
| jobs: | |
| test: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Harden the runner (Audit all outbound calls) | |
| uses: step-security/harden-runner@20cf305ff2072d973412fa9b1e3a4f227bda3c76 # v2.14.0 | |
| with: | |
| egress-policy: audit | |
| - | |
| uses: actions/checkout@ee0669bd1cc54295c223e0bb666b733df41de1c5 # v2.7.0 | |
| - | |
| name: Install shfmt | |
| run: sudo snap install shfmt | |
| - | |
| name: Run shfmt | |
| run: shfmt -d entrypoint.sh | |
| - | |
| name: Install Python | |
| uses: actions/setup-python@e9aba2c848f5ebd159c070c61ea2c4e2b122355e # v2.3.4 | |
| with: | |
| python-version: '3.x' | |
| cache: 'pip' | |
| - | |
| name: Install Python packages | |
| run: pip install -r requirements.txt | |
| - | |
| name: Lint with flake8 | |
| run: flake8 . | |
| - | |
| name: Run isort | |
| run: isort --check --diff . | |
| - | |
| name: Run black | |
| run: black --check --diff . | |
| - | |
| name: Run tests | |
| run: pytest -v | |
| env: | |
| PYTHONPATH: "." |