diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 27d2d8a3..34ea9b7e 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -1,4 +1,4 @@ -name: build +name: test on: push: @@ -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