Search alerts #11266
This file contains 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: Test | |
on: [push, pull_request] | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
app: | |
- peachjam | |
- africanlii | |
- lawlibrary | |
- liiweb | |
services: | |
postgres: | |
image: postgres:15 | |
env: | |
POSTGRES_PASSWORD: postgres | |
ports: | |
- 5432:5432 | |
## db health checks | |
options: >- | |
--health-cmd pg_isready | |
--health-interval 10s | |
--health-timeout 5s | |
--health-retries 3 | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up Python Environment | |
uses: actions/setup-python@v5 | |
with: | |
python-version: "3.10" | |
cache: 'pip' | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: '18' | |
- name: Install dependencies | |
run: | | |
sudo apt-get -y update | |
sudo apt-get install -y libreoffice poppler-utils | |
python -m pip install --upgrade setuptools wheel | |
pip install . | |
pip install psycopg2-binary==2.9.3 unittest-xml-reporting | |
npm ci --no-audit --ignore-scripts --only=prod | |
npm i -g sass | |
- name: Run tests | |
env: | |
DATABASE_URL: "postgres://postgres:postgres@localhost:5432/peach-jam" | |
TEST_RUNNER: "xmlrunner.extra.djangotestrunner.XMLTestRunner" | |
run: | | |
pre-commit run --all-files | |
python manage.py test ${{ matrix.app }} --settings=${{ matrix.app }}.settings | |
- name: Publish Test Results | |
uses: EnricoMi/publish-unit-test-result-action/linux@v2 | |
if: success() || failure() | |
continue-on-error: true | |
with: | |
files: test-reports/*.xml |