diff --git a/.github/actions/in-container/action.yml b/.github/actions/in-container/action.yml deleted file mode 100644 index eec1d4544..000000000 --- a/.github/actions/in-container/action.yml +++ /dev/null @@ -1,46 +0,0 @@ -name: 'In container action' -description: 'Runs specified commands inside the specified container.' -inputs: - run: - description: 'Commands to run inside context' - required: true - shell: - description: 'shell to run command on inside docker' - default: 'bash --noprofile --norc -eo pipefail' - app: - description: 'docker-compose app to run command in' - required: true - default: 'web' - use_dev_image: - description: 'Can this use the current dev image or should it rebuild from scratch (still some layer caching benefits)' - default: 'false' - -runs: - using: "composite" - - steps: - - name: Build image from docker-compose - if: ${{ inputs.use_dev_image == 'false' }} - uses: ./.github/actions/cached-build - with: - branch: "master" - push_to_registry: false - - - name: construct docker command - shell: bash - run: | - if [ "$USE_DEV_IMAGE" = "true" ]; then - composeFiles="-f docker-compose.yml -f .devcontainer/docker-compose-extend-cached-image.yml" - else - composeFiles="-f docker-compose.yml" - fi - shellCommands='$@' - echo "docker-compose $composeFiles run --volume /home/runner:/home/runner/ ${{ inputs.app }} ${{ inputs.shell }} $shellCommands" > ${{ github.action_path }}/docker_command.sh - echo "${{ github.action_path }}" >> $GITHUB_PATH - env: - USE_DEV_IMAGE: ${{ inputs.use_dev_image}} - - - name: Run script in docker - shell: bash docker_command.sh {0} - run: | - ${{ inputs.run }} diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 3b9e55c07..1dfbb9d64 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -10,27 +10,20 @@ on: jobs: tests: - runs-on: ubuntu-latest + runs-on: python:3.12 steps: - - name: checkout repo content uses: actions/checkout@v2 - + - name: install poetry + run: curl -sSL https://install.python-poetry.org | python3 - + - name: install dependencies + run: poetry install - name: Run django tests - uses: ./.github/actions/in-container - with: - use_dev_image: false - run: | - script/bootstrap - script/test --coverage - - # do this inside the docker container otherwise the paths don't work + run: | + script/bootstrap + script/test --coverage - name: generate coverage xml - uses: ./.github/actions/in-container - with: - run: coverage xml - - # do this outside the docker container otherwise can't get repo details + run: coverage xml - name: upload code coverage run: | less coverage.xml