Skip to content

Commit

Permalink
Running test code from tox in GH actions
Browse files Browse the repository at this point in the history
  • Loading branch information
tnixon committed Nov 3, 2023
1 parent 357ec49 commit 824ebb4
Showing 1 changed file with 19 additions and 60 deletions.
79 changes: 19 additions & 60 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: build
name: test

on:
push:
Expand All @@ -7,72 +7,31 @@ on:
branches: [ 'master' ]

jobs:
black-linting:
lint:
runs-on: ubuntu-latest
name: Black Lint
steps:
- uses: actions/checkout@v2
- uses: psf/black@stable
with:
options: "--check --verbose"
src: "./python"
version: "23.3.0"
flake8-lint:
runs-on: ubuntu-latest
name: Flake8 Lint
name: Run Linters
steps:
- name: Check out source repository
uses: actions/checkout@v2
uses: actions/checkout@v4
- name: Set up Python environment
uses: actions/setup-python@v2
with:
python-version: "3.9"
- name: flake8 Lint
uses: py-actions/flake8@v2
uses: actions/setup-python@v4
with:
args: "--config python/.flake8"
path: "./python"
python-version: "3.10"
- name: Install Tox
run: pip install tox
- name: Run Linters
run: tox -e lint
type-checks:
runs-on: ubuntu-latest
name: Type Checks
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
- name: Check out source repository
uses: actions/checkout@v4
- name: Set up Python environment
uses: actions/setup-python@v4
with:
python-version: "3.9"
- name: Type check
working-directory: ./python
run: |
pip install tox
tox -e type-check
test:
name: Build and Test Module
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest]
env:
OS: ${{ matrix.os }}
PYTHON: '3.9'
steps:
- uses: actions/checkout@master
- name: Setup Python
uses: actions/setup-python@master
with:
python-version: 3.9
- name: Set Spark env
run: |
export SPARK_LOCAL_IP=127.0.0.1
export SPARK_SUBMIT_OPTS="--illegal-access=permit -Dio.netty.tryReflectionSetAccessible=true"
- name: Generate coverage report
working-directory: ./python
run: |
python -I -m pip install 'coverage<8,>=7' pyspark==3.2.1 -r requirements.txt
coverage run -m unittest discover -s tests -p '*_tests.py'
coverage combine
coverage xml
- name: Publish test coverage
uses: codecov/codecov-action@v3
with:
fail_ci_if_error: true
files: ./python/coverage.xml
python-version: "3.10"
- name: Install Tox
run: pip install tox
- name: Run Type Checks
run: tox -e type-check

0 comments on commit 824ebb4

Please sign in to comment.