Skip to content

Commit

Permalink
GHA testing
Browse files Browse the repository at this point in the history
  • Loading branch information
jennydaman committed Jul 27, 2024
1 parent 8347b2d commit c66139e
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 7 deletions.
35 changes: 35 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Test

on:
push:
branches: [ master ]
paths:
- '.github/workflows/test.yml'
- '**.py'
pull_request:

jobs:
test:
name: Tests
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
- name: Spin up ChRIS
uses: FNNDSC/miniChRIS-docker@master
with:
# for testing, we need to create plugin instances, but we don't need the plugins to actually run.
services: chris oxidicom graphql-engine
- name: Build
run: docker compose build test
- name: Test
id: test
continue-on-error: true # we want to upload coverage, even on failure
run: docker compose run -T --use-aliases test
- name: Copy coverage.xml from container
run: docker cp "$(docker compose ps -a test -q | tail -n 1):/app/coverage.xml" coverage.xml
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v4
with:
files: ./coverage.xml
fail_ci_if_error: true
token: ${{ secrets.CODECOV_TOKEN }}
6 changes: 0 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,12 +55,6 @@ so we need to run them with Docker Compose:
docker compose run test
```

Coverage data can be obtained from the stopped test container:

```shell
docker cp "$(docker compose ps -a test -q | tail -n 1):/app/coverage.xml" coverage.xml
```

### Deployment

See https://github.com/FNNDSC/charts
2 changes: 1 addition & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ services:
context: .
args:
REQUIREMENTS_FILE: requirements-dev.lock
command: pytest --run-e2e --cov=serie --cov-report=xml
command: pytest --color=yes --run-e2e --cov=serie --cov-report=xml
working_dir: /app
volumes:
# /app is a volume and the source code files are binded as subdirectories
Expand Down

0 comments on commit c66139e

Please sign in to comment.