-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from FNNDSC/wip
WIP stuff and automatic testing in GitHub Actions
- Loading branch information
Showing
30 changed files
with
898 additions
and
69 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,6 +2,7 @@ | |
.gitignore | ||
.dockerignore | ||
.idea | ||
.venv | ||
Dockerfile | ||
docker-compose.yml | ||
README.md |
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
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 }} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,4 @@ | ||
.idea | ||
__pycache__ | ||
/src/serie/version.txt | ||
/.test_data |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,11 @@ | ||
FROM python:3.12.3-alpine | ||
|
||
WORKDIR /app | ||
COPY requirements.lock ./ | ||
RUN PYTHONDONTWRITEBYTECODE=1 pip install --no-cache-dir -r requirements.lock | ||
ARG REQUIREMENTS_FILE=requirements.lock | ||
COPY ${REQUIREMENTS_FILE} ./requirements.txt | ||
RUN --mount=type=cache,sharing=locked,target=/root/.cache/pip \ | ||
sed -i' ' -e '/-e file:\./d' requirements.txt \ | ||
&& env PYTHONDONTWRITEBYTECODE=1 pip install -r requirements.txt | ||
|
||
COPY src . | ||
CMD ["fastapi", "run", "main.py"] |
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,17 @@ | ||
[project] | ||
name = "serie" | ||
version = "0.1.0" | ||
version = "0.0.0" # <-- version in pyproject.toml is ignored. Set the version in src/serie/version.txt | ||
description = "Specific Endpoints for Research Integration Events" | ||
authors = [ | ||
{ name = "FNNDSC", email = "[email protected]" } | ||
] | ||
dependencies = [ | ||
"fastapi>=0.111.1", | ||
"aiochris~=0.5.0", | ||
"aiochris~=0.8.0", | ||
"yarl>=1.9.4", | ||
"asyncstdlib>=3.12.4", | ||
"pydantic-settings>=2.3.4", | ||
"requests>=2.32.3", | ||
] | ||
readme = "README.md" | ||
requires-python = ">= 3.12" | ||
|
@@ -19,8 +22,17 @@ build-backend = "hatchling.build" | |
|
||
[tool.rye] | ||
managed = true | ||
dev-dependencies = [] | ||
virtual = true | ||
dev-dependencies = [ | ||
"pytest>=8.3.2", | ||
"pytest-asyncio>=0.23.8", | ||
"asyncio>=3.4.3", | ||
"aiohttp>=3.9.5", | ||
"pydicom>=2.4.4", | ||
"asyncer>=0.0.7", | ||
"pynetdicom>=2.1.0", | ||
"docker>=7.1.0", | ||
"pytest-cov>=5.0.0", | ||
] | ||
|
||
[tool.hatch.metadata] | ||
allow-direct-references = true | ||
|
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
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
Oops, something went wrong.