diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 00000000..371040a4 --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,50 @@ +name: Test + +on: + push: + branches: [ "master", "main" ] + pull_request: + branches: [ "master", "main" ] + +permissions: + contents: read + +jobs: + build-and-test: + runs-on: ubuntu-latest + strategy: + matrix: + python-version: ["3.9", "3.11", "3.13"] + + steps: + - uses: actions/checkout@v4 + + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v5 + with: + python-version: ${{ matrix.python-version }} + + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install ".[test]" + + - name: Run pytest tests + run: | + mkdir -p test-results + pytest --junitxml=test-results/junit.xml -o junit_family=legacy + + - name: Upload test results + if: always() + uses: actions/upload-artifact@v4 + with: + name: test-results-${{ matrix.python-version }} + path: test-results/ + + - name: Color TextModeTrees + run: | + udapy read.Conllu files=udapi/core/tests/data/babinsky.conllu write.TextModeTrees color=1 + + - name: External tests + run: | + cd udapi/core/tests && bash external_tests.sh diff --git a/.gitignore b/.gitignore index a75e7c05..325f4ab2 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,6 @@ .idea *.pyc .cache +build/ +*.egg-info/ +test-results/