Skip to content

Commit 922a8fc

Browse files
committed
Merge branch 'main' into medcat-v2-testing
2 parents c9282e4 + 221eba2 commit 922a8fc

File tree

19 files changed

+2629
-405
lines changed

19 files changed

+2629
-405
lines changed

medcat-trainer/.github/workflows/ci.yml

Lines changed: 35 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,44 @@ name: ci-build
33
on: [push]
44

55
jobs:
6-
# run tests / lint / etc. before building container image?
6+
# Test and build client library
7+
test-client:
8+
runs-on: ubuntu-latest
9+
steps:
10+
- name: Checkout main
11+
uses: actions/checkout@v4
12+
with:
13+
ref: ${{ github.ref }}
14+
15+
- name: Set up Python
16+
uses: actions/setup-python@v4
17+
with:
18+
python-version: '3.10'
19+
20+
- name: Install dependencies
21+
run: |
22+
python -m pip install --upgrade pip
23+
pip install requests pytest build
24+
25+
- name: Install client package in development mode
26+
run: |
27+
cd client
28+
pip install -e .
29+
30+
- name: Run client tests
31+
run: |
32+
cd client
33+
python -m pytest tests/ -v
34+
35+
- name: Build client package
36+
run: |
37+
cd client
38+
python -m build
739
40+
# Build and test webapp container
841
build-and-push:
942
runs-on: ubuntu-latest
43+
needs: test-client
1044
steps:
1145
- name: Checkout main
1246
uses: actions/checkout@v4

medcat-trainer/.github/workflows/qa.yml

Lines changed: 41 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,50 @@ on:
55
branches: [ main ]
66

77
jobs:
8-
# run tests / lint / etc. before building container image?
8+
# Test and build client library
9+
test-client:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Checkout main
13+
uses: actions/checkout@v4
14+
with:
15+
ref: 'main'
16+
17+
- name: Set up Python
18+
uses: actions/setup-python@v4
19+
with:
20+
python-version: '3.10'
21+
22+
- name: Install dependencies
23+
run: |
24+
python -m pip install --upgrade pip
25+
pip install requests pytest build
26+
27+
- name: Install client package in development mode
28+
run: |
29+
cd client
30+
pip install -e .
31+
32+
- name: Run client tests
33+
run: |
34+
cd client
35+
python -m pytest tests/ -v
36+
37+
- name: Build client package
38+
run: |
39+
cd client
40+
python -m build
41+
42+
- name: Publish dev distribution to Test PyPI
43+
uses: pypa/[email protected]
44+
with:
45+
password: ${{ secrets.TEST_PYPI_API_TOKEN }}
46+
repository_url: https://test.pypi.org/legacy/
947

48+
# Build and test webapp container
1049
build-and-push:
1150
runs-on: ubuntu-latest
51+
needs: test-client
1252
steps:
1353
- name: Checkout main
1454
uses: actions/checkout@v4

medcat-trainer/.github/workflows/release.yml

Lines changed: 44 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,53 @@ on:
55
tags: ["v*.*.*"]
66

77
jobs:
8-
# run tests / lint / etc. before building container image?
8+
# Test, build and publish client library
9+
test-and-publish-client:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Checkout main
13+
uses: actions/checkout@v4
14+
with:
15+
ref: "main"
16+
17+
- name: Release Tag
18+
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
19+
20+
- name: Set up Python
21+
uses: actions/setup-python@v4
22+
with:
23+
python-version: '3.10'
24+
25+
- name: Install dependencies
26+
run: |
27+
python -m pip install --upgrade pip
28+
pip install requests pytest build twine
29+
30+
- name: Install client package in development mode
31+
run: |
32+
cd client
33+
pip install -e .
34+
35+
- name: Run client tests
36+
run: |
37+
cd client
38+
python -m pytest tests/ -v
39+
40+
- name: Build client package
41+
run: |
42+
cd client
43+
python -m build
44+
45+
- name: Publish production distribution to PyPI
46+
if: startsWith(github.ref, 'refs/tags') && ! github.event.release.prerelease
47+
uses: pypa/[email protected]
48+
with:
49+
password: ${{ secrets.PYPI_API_TOKEN }}
950

51+
# Build and test webapp container
1052
build-and-push:
1153
runs-on: ubuntu-latest
54+
needs: test-and-publish-client
1255
steps:
1356
- name: Checkout main
1457
uses: actions/checkout@v4

0 commit comments

Comments
 (0)