Merge branch 'testing-sandbox-refactor' #170
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: Nox | |
| on: | |
| push: | |
| branches: | |
| - main | |
| pull_request: | |
| workflow_dispatch: | |
| # Limit this workflow to a single run at a time per-branch to avoid wasting worker resources | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| # JOB | |
| nox-other: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| session: [precommit, audit] | |
| steps: | |
| - uses: level12/coppy/gh-actions/nox-run@main | |
| with: | |
| nox-session: ${{ matrix.session }} | |
| # JOB | |
| nox-pytest: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: level12/coppy/gh-actions/uv-prep@main | |
| with: | |
| # Copier errors out with a shallow repo clone. This makes it a full clone. | |
| fetch-depth: 0 | |
| - name: Prep test user | |
| run: | | |
| # The script returns early after adding the current user to the new user's group. | |
| # This is due to the need to "logout" before the user pick's up the group's identity. | |
| uv run --no-dev tasks/test-user-prep.py | |
| # Permissions for the test user operate assuming the group sticky bit. Having acls for | |
| # the runner user results in the sticky bit not working as intended. So clear them. | |
| sudo setfacl -R -b /home/coppy-tests/ | |
| # Permissive umask to avoid group write being masked out | |
| umask 000 | |
| # Workaround for: https://github.com/actions/runner-images/issues/13049 | |
| sudo sed -i '/XDG_RUNTIME_DIR\|\(=\/home\/runner\)/d' /etc/environment | |
| # Run prep again, this time giving the runner user access to the group created above. | |
| # This is necessary because, as best I can tell, there is no way to logout and then | |
| # back in to give the runner access to that group. | |
| sg coppy-tests -c 'uv run --no-dev tasks/test-user-prep.py --systemd-skip' | |
| - name: Run pytest | |
| run: | | |
| # Permissive umask to avoid group write being masked out | |
| umask 000 | |
| sg coppy-tests -c 'uv run --frozen --only-group nox -- nox -s pytest' |