update example/readme #33
Workflow file for this run
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: Run tests | |
on: | |
push: | |
branches: | |
- "main" | |
pull_request: | |
branches: | |
- "main" | |
jobs: | |
unit-tests: | |
runs-on: ubuntu-latest | |
env: | |
COMPOSE_FILE: docker-compose.yml | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
with: | |
lfs: true | |
- name: Checkout LFS objects for test cases | |
run: git lfs checkout | |
- name: Log in to the Container registry | |
uses: docker/login-action@v2 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Build docker images | |
env: | |
EARTHDATA_TOKEN: "${{ secrets.EARTHDATA_TOKEN }}" | |
run: | | |
COMPOSE_DOCKER_CLI_BUILD=1 DOCKER_BUILDKIT=1 docker compose build | |
- name: Run unit and integration tests | |
env: | |
EARTHDATA_TOKEN: "${{ secrets.EARTHDATA_TOKEN }}" | |
run: | | |
docker compose run test pytest --ignore=/src/tests/test_main.py -vv | |
- name: Start server and test sample request | |
env: | |
EARTHDATA_TOKEN: "${{ secrets.EARTHDATA_TOKEN }}" | |
run: | | |
COMPOSE_DOCKER_CLI_BUILD=1 DOCKER_BUILDKIT=1 docker compose -f docker-compose.yml up -d | |
sleep 5 | |
docker ps -a | |
docker compose -f docker-compose.yml exec -T test pytest tests/test_main.py -vv |