-
Notifications
You must be signed in to change notification settings - Fork 3
58 lines (47 loc) · 1.45 KB
/
ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
name: Continuous Integration
on:
push:
pull_request:
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
python-version:
- '3.9'
- '3.12'
steps:
- name: Checkout Repository
uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install Dependencies
run: |
pip -q install poetry pre-commit
poetry install
- name: Pre-commit Checks
run: pre-commit run --all-files
- name: Unit Tests
run: poetry run pytest
- name: Run Example
run: poetry run python example.py > case.jsonld
# Ensure that the example output is a valid CASE JSON-LD graph
- name: CASE Export Validation
uses: kchason/[email protected]
with:
case-path: ./
case-version: "case-1.3.0"
extension-filter: "jsonld"
# Always build the package as a sanity check to ensure no issues with the build system
# exist as part of the CI process
- name: Build Package
run: |
poetry build
# Only push to PyPi when a tag is created starting with 'v'
- name: Push to PyPi
if: startsWith(github.ref, 'refs/tags/v')
run: |
poetry config pypi-token.pypi ${{ secrets.PYPI_TOKEN }}
poetry publish