diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d93e146..c9936f3 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,21 +1,41 @@ name: CI on: - push: pull_request: + push: + branches: + - main + workflow_dispatch: permissions: contents: read +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + jobs: validate: + name: Validate and test runs-on: ubuntu-latest + timeout-minutes: 5 + steps: - - uses: actions/checkout@v4 - - uses: actions/setup-python@v5 + - name: Check out repository + uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4 + with: + persist-credentials: false + + - name: Set up Python + uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5 with: python-version: "3.12" - - name: Validate repository - run: python3 scripts/check_repository.py + + - name: Compile Python + run: python -m compileall -q scripts tests + + - name: Validate repository files + run: python scripts/check_repository.py + - name: Run tests - run: python3 -m unittest discover -s tests -v + run: python -m unittest discover --start-directory tests --verbose