-
Notifications
You must be signed in to change notification settings - Fork 2
70 lines (55 loc) · 1.86 KB
/
test.yml
File metadata and controls
70 lines (55 loc) · 1.86 KB
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
59
60
61
62
63
64
65
66
67
68
69
70
name: test pySubDisc
on:
push:
branches: [ main ]
jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Find SubDisc commit
run: |
echo "subdisc_commit=$(grep '^SubDisc' src/pysubdisc/VERSION | cut -d' ' -f 2)" >> $GITHUB_ENV
- name: Checkout SubDisc
uses: actions/checkout@v4
with:
repository: SubDisc/SubDisc
ref: ${{ env.subdisc_commit }}
path: ext/SubDisc
# We need to fetch the full history because the commit count is used
# to identify the SubDisc version.
fetch-depth: 0
- name: Set up JDK 11
uses: actions/setup-java@v4
with:
java-version: '11'
distribution: 'temurin'
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: 3.11
- name: Build SubDisc with Maven
run: mvn package
working-directory: ./ext/SubDisc
- name: Get SubDisc revision
run: |
echo "subdisc_revision=$(git -C ext/SubDisc rev-list HEAD --count)" >> $GITHUB_ENV
- name: Copy jar
run: |
mkdir -p src/pysubdisc/jars
cp ext/SubDisc/target/subdisc-gui.jar src/pysubdisc/jars/subdisc-gui-r${{ env.subdisc_revision }}.jar
- name: Add jar version info
run: |
sed -i -e s/9999/${{ env.subdisc_revision }}/ src/pysubdisc/VERSION
echo "pysubdisc_version=$(grep '^pySubDisc' src/pysubdisc/VERSION | cut -d' ' -f 2)" >> $GITHUB_ENV
echo "Using SubDisc commit ${{ env.subdisc_commit }}, revision ${{ env.subdisc_revision }}"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install build pytest
- name: Install
run: pip install .
- name: Test with pytest
# The pytest faulthandler interferes with jpype
run: pytest -p no:faulthandler