-
Notifications
You must be signed in to change notification settings - Fork 6
69 lines (59 loc) · 2.16 KB
/
python-test.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
59
60
61
62
63
64
65
66
67
68
69
# This workflow will install Python dependencies and run tests with a single version of Python
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python
name: Python test
on: [push]
# pull_request:
# branches: [ "trunk" ]
permissions:
contents: read
jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
# Set up Python environment (with virtualenv)
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.9' # or whatever version you're using
# Create a virtual environment (optional but recommended)
- name: Create virtual environment
run: |
python -m venv venv
source venv/bin/activate
# Install dependencies (including delphin and ace)
- name: Install Delphin
run: |
source venv/bin/activate
pip install --upgrade pip
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
- name: Install ace (download tar and move executable to virtual bin)
run: |
source venv/bin/activate
TAR_URL="https://sweaglesw.org/linguistics/ace/download/ace-0.9.34-x86-64.tar.gz"
curl -L $TAR_URL -o /tmp/file.tar.gz
mkdir -p /tmp/extracted
tar -xzvf /tmp/file.tar.gz -C /tmp/extracted
chmod +x /tmp/extracted/ace-0.9.34/ace
sudo mv /tmp/extracted/ace-0.9.34/ace $VIRTUAL_ENV/bin/ace
# Run regression test suite
- name: Test
id: run-tests
run: |
source venv/bin/activate
python3 rtest.py wh-*
continue-on-error: true
- name: Upload test logs as artifact
if: always()
uses: actions/upload-artifact@v4
with:
name: test-logs
path: /home/runner/work/matrix/matrix/tests/regression/logs/*
- name: Fail the job if the tests failed
if: always()
run: |
if [ ${{ steps.run-tests.outcome }} != 'success' ]; then
echo "Tests failed. Check logs for details."
exit 1
fi