add ansi-safe casting #984
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: build | |
| on: | |
| pull_request: | |
| types: [ opened, synchronize ] | |
| push: | |
| branches: [ main ] | |
| release: | |
| types: [ published ] | |
| jobs: | |
| unittesting: | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| max-parallel: 1 | |
| matrix: | |
| os: [ ubuntu-latest ] | |
| env: | |
| HADOOP_USER_HOME: 'hadoop' | |
| UNIT_TESTING_ENV: 'spark_expectations_unit_testing_on_github_actions' | |
| steps: | |
| - uses: actions/checkout@v5 # use latest version of the checkout action | |
| - name: Set up JDK | |
| uses: actions/setup-java@v3 | |
| with: | |
| java-version: '17' | |
| distribution: 'temurin' | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: | | |
| 3.10 | |
| 3.11 | |
| 3.12 | |
| check-latest: true | |
| - name: Install Hatch | |
| uses: pypa/hatch@install | |
| - name: Setup Kafka | |
| run: | | |
| curl -SL "https://archive.apache.org/dist/kafka/3.0.0/kafka_2.13-3.0.0.tgz" | tar -xzC /tmp | |
| export PATH=$PATH:/tmp/kafka_2.13-3.0.0/bin | |
| echo "KAFKA_HOME=/tmp/kafka_2.13-3.0.0" >> $GITHUB_ENV | |
| - name: Install dependencies | |
| run: | | |
| export PATH=$PATH:$HOME/.local/bin | |
| make deploy_env_setup | |
| - name: Install, lint and test | |
| run: | | |
| export PATH=$PATH:$HOME/.local/bin | |
| export GITHUB_ACTIONS=true | |
| make cov | |
| - name: Upload coverage reports to Codecov | |
| uses: codecov/codecov-action@v5 | |
| with: | |
| fail_ci_if_error: true | |
| files: ./coverage.xml | |
| verbose: true | |
| slug: Nike-Inc/spark-expectations | |
| token: ${{ secrets.CODECOV_TOKEN }} | |
| deploy: | |
| name: Deploy to PyPi | |
| needs: | |
| - unittesting | |
| if: github.event_name == 'release' | |
| strategy: | |
| matrix: | |
| os: [ubuntu-latest] | |
| runs-on: ${{ matrix.os }} | |
| steps: | |
| - uses: actions/checkout@v5 # use latest version of the checkout action | |
| with: | |
| fetch-depth: 0 # fetch all commits/branches, needed for publish docs | |
| - name: Set up JDK | |
| uses: actions/setup-java@v3 | |
| with: | |
| java-version: '17' | |
| distribution: 'temurin' | |
| - name: Configure Git User | |
| run: | | |
| git config user.name "github-actions[bot]" | |
| git config user.email "github-actions[bot]@users.noreply.github.com" | |
| - name: Set up Python | |
| # https://github.com/actions/setup-python/blob/main/docs/advanced-usage.md#specifying-multiple-pythonpypy-versions | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: | | |
| 3.10 | |
| 3.11 | |
| 3.12 | |
| check-latest: true | |
| - name: Install Hatch | |
| uses: pypa/hatch@install | |
| - name: Install dependencies | |
| run: | | |
| export PATH=$PATH:$HOME/.local/bin | |
| make deploy_env_setup | |
| - name: Install wheel and twine | |
| run: python -m pip install wheel twine | |
| - name: Build and publish | |
| env: | |
| TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }} | |
| TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }} | |
| run: | | |
| export PATH=$PATH:$HOME/.local/bin | |
| make build | |
| twine upload dist/* | |
| - name: Publish Docs | |
| run: | | |
| export PATH=$PATH:$HOME/.local/bin | |
| VERSION=$(hatch version) | |
| make deploy-docs version=$VERSION | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |