Skip to content

Commit

Permalink
Create test.yml GitHub workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
ianhinder authored Sep 17, 2024
1 parent 23ac5dd commit 1354283
Showing 1 changed file with 36 additions and 0 deletions.
36 changes: 36 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@

name: Run tests

on:
workflow_dispatch:
pull_request:
push:

jobs:
build-and-test:
runs-on: ubuntu-latest

permissions:
contents: read
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Test people.json is valid JSON
run: |
python3 -c 'import json; json.load(open("people.json"))'
- name: Test image builds
run: |
docker compose -f compose.yml build
- name: Test container can start and is healthy
run: |
# Launch the project from docker-compose.yml and wait up to
# 30s for its built-in health check to return "healthy"
docker compose -f compose.yml up --wait --wait-timeout 30
docker compose -f compose.yml down
# - name: Run Pytest tests
# run: |
# docker compose -f compose.yml run --entrypoint "" web pytest

0 comments on commit 1354283

Please sign in to comment.