Skip to content

Add testing artefacts to github actions #11

Description

@allynt

Something like this:

name: build
run-name: build (invoked by ${{ github.actor }})

on: [push, workflow_dispatch]

jobs:
  server-tests:
    runs-on: ubuntu-20.04
    timeout-minutes: 15
    continue-on-error: true
    services:
      db:
        image: kartoza/postgis:15
        env:
          POSTGRES_USER: user
          POSTGRES_PASS: pwd
          POSTGRES_DBNAME: db
          ALLOW_IP_RANGE: 0.0.0.0/0
        ports:
          - 5666:5432
    steps:
      - name: Checkout repository
        uses: actions/checkout@v3
      - name: setup Python and PDM
        uses: pdm-project/setup-pdm@v3
        with:
          python-version: 3.10.0
          enable-pep582: true
      - name: Install dependencies
        run: |
          sudo apt-get update
          sudo apt-get install -y postgresql-client python3-gdal
          pdm install --dev
      - name: Run server tests
        env:
          DJANGO_ENVIRONMENT: "ci"
          DJANGO_SETTINGS_MODULE: "config.settings"
          DATABASE_URL: "postgis://user:pwd@localhost:5666/db"
        run: |
          pdm run ./manage.py migrate --noinput
          pdm run test
      - name: Upload server test report
        uses: actions/upload-artifact@v3
        with:
          name: pytest-report
          path: |
            server/pytest-report.html
            server/output.json
            server/archive/*

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions