Skip to content

Commit

Permalink
chore: tesst and publish CI for icij-common and icij-worker:wq
Browse files Browse the repository at this point in the history
  • Loading branch information
ClemDoum committed Mar 13, 2024
1 parent 66f4653 commit d449c4b
Show file tree
Hide file tree
Showing 16 changed files with 943 additions and 22 deletions.
9 changes: 3 additions & 6 deletions .github/workflows/linting-common.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,13 @@ on:
pull_request:
paths:
- 'icij-common/**.py'
push:
paths:
- 'icij-common/**.py'
- '.github/workflows/tests-common.yml'

# TODO: leverage some caching here
jobs:
linting-test-icij-common:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: ./.github/actions/pylint
with:
path: icij-common
path: icij-common
4 changes: 2 additions & 2 deletions .github/workflows/linting-worker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
linting-test-icij-worker:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: ./.github/actions/pylint
with:
path: icij-worker
path: icij-worker
30 changes: 30 additions & 0 deletions .github/workflows/publish-common.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Publish icij-common

on:
push:
tags:
- icij-common-*

jobs:
publish-icij-common:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install poetry
run: pipx install poetry
- name: Setup Python project
uses: actions/setup-python@v5
with:
python-version: 3.9
cache: poetry
- name: Install Python project
run: cd icij-common && poetry install --with dev --sync
# We assume tests have run in a previous workflow and just build and publish
- name: Build and publish
env:
PYPI_API_TOKEN: ${{ secrets.PYPI_API_TOKEN }}
run: |
cd icij-common
poetry build
poetry config pypi-token.pypi {{ env.PYPI_API_TOKEN }}
poetry publish
30 changes: 30 additions & 0 deletions .github/workflows/publish-worker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Publish icij-worker

on:
push:
tags:
- icij-worker-*

jobs:
publish-icij-worker:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install poetry
run: pipx install poetry
- name: Setup Python project
uses: actions/setup-python@v5
with:
python-version: 3.9
cache: poetry
- name: Install Python project
run: cd icij-worker && poetry install --with dev --sync
# We assume tests have run in a previous workflow and just build and publish
- name: Build and publish
env:
PYPI_API_TOKEN: ${{ secrets.PYPI_API_TOKEN }}
run: |
cd icij-worker
poetry build
poetry config pypi-token.pypi {{ env.PYPI_API_TOKEN }}
poetry publish
42 changes: 42 additions & 0 deletions .github/workflows/tests-common.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Test for icij-common

on:
pull_request:
paths:
- 'icij-common/**.py'
- '.github/workflows/tests-common.yml'

jobs:
test-icij-common:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install poetry
run: pipx install poetry
- name: Setup Python project
uses: actions/setup-python@v5
with:
# TODO: use a version matrix here
python-version: 3.9
cache: poetry
- name: Install Python project
run: cd icij-common && poetry install -v --with dev --sync
- name: Run tests
run: |
cd icij-common
poetry run python -m pytest -vvv --cache-clear --show-capture=all -r A .
services:
neo4j:
image: neo4j:4.4.17
env:
NEO4J_AUTH: neo4j/theneo4jpassword
NEO4JLABS_PLUGINS: '["apoc"]'
options: >-
--health-cmd "cypher-shell -u neo4j -p theneo4jpassword -d neo4j 'CALL db.ping()'"
--health-interval 2s
--health-timeout 2s
--health-retries 10
--health-start-period 20s
ports:
- 7475:7474
- 7688:7687
41 changes: 41 additions & 0 deletions .github/workflows/tests-worker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Test for icij-worker

on:
pull_request:
paths:
- 'icij-worker/**.py'
- '.github/workflows/tests-worker.yml'

jobs:
test-icij-worker:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install poetry
run: pipx install poetry
- name: Setup Python project
uses: actions/setup-python@v5
with:
# TODO: use a version matrix here
python-version: 3.9
cache: poetry
- run: cd icij-worker && poetry install -v --with dev --sync
- name: Run tests
run: |
cd icij-worker
poetry run python -m pytest -vvv --cache-clear --show-capture=all -r A .
services:
neo4j:
image: neo4j:4.4.17
env:
NEO4J_AUTH: neo4j/theneo4jpassword
NEO4JLABS_PLUGINS: '["apoc"]'
options: >-
--health-cmd "cypher-shell -u neo4j -p theneo4jpassword -d neo4j 'CALL db.ping()'"
--health-interval 2s
--health-timeout 2s
--health-retries 10
--health-start-period 20s
ports:
- 7475:7474
- 7688:7687
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Monorepository for ICIJ's Python libraries
# Monorepo for ICIJ Python libs

## Libraries
- [icij-common](icij-common)
- [icij-worker](icij-worker)
## [icij-common](icij-common) [![Test for icij-common](https://github.com/ICIJ/icij-python/actions/workflows/tests-common.yml/badge.svg)](https://github.com/ICIJ/icij-python/actions/workflows/tests-common.yml)

## [icij-worker](icij-worker) [![Test for icij-worker](https://github.com/ICIJ/icij-python/actions/workflows/tests-worker.yml/badge.svg)](https://github.com/ICIJ/icij-python/actions/workflows/tests-worker.yml)
1 change: 0 additions & 1 deletion icij-common/.gitignore

This file was deleted.

Loading

0 comments on commit d449c4b

Please sign in to comment.