Skip to content

Commit

Permalink
ci: update pytest to use docker ci img
Browse files Browse the repository at this point in the history
  • Loading branch information
spwoodcock committed Aug 31, 2023
1 parent 6ad7806 commit 32498a7
Showing 1 changed file with 12 additions and 13 deletions.
25 changes: 12 additions & 13 deletions .github/workflows/pytest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,24 +12,23 @@ on:
# Allow manual trigger (workflow_dispatch)
workflow_dispatch:

permissions:
contents: read

jobs:
test:
runs-on: ubuntu-latest
environment:
name: ${{ github.ref_name }}

container:
image: ghcr.io/hotosm/fmtm-splitter:ci
volumes:
# Mount / test files in commit
- ./fmtm_splitter:/home/appuser/.local/lib/python3.10/site-packages/fmtm_splitter
- ./tests:/home/appuser/tests
options: --user root

steps:
- uses: actions/checkout@v3
- name: Run pytest as appuser
run: gosu appuser pytest

- name: Start CI Container
run: >
docker run -d --name fmtm_pytest
-v "$GITHUB_WORKSPACE/fmtm_splitter:/home/appuser/.local/lib/python3.10/site-packages/fmtm_splitter"
-v "$GITHUB_WORKSPACE/tests:/home/appuser/tests"
-u root
ghcr.io/hotosm/fmtm-splitter:ci
sleep infinity
- name: Run PyTest as appuser
run: docker exec fmtm_pytest gosu appuser pytest

0 comments on commit 32498a7

Please sign in to comment.