add contrast to edistance #2913
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: GPU Tests | |
| on: | |
| push: | |
| branches: [main] | |
| pull_request: | |
| types: | |
| - labeled | |
| - opened | |
| - synchronize | |
| # Cancel the job if new commits are pushed | |
| # https://stackoverflow.com/questions/66335225/how-to-cancel-previous-runs-in-the-pr-when-you-push-new-commitsupdate-the-curre | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| check: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: flying-sheep/check@v1 | |
| with: | |
| success: ${{ github.event_name == 'push' || contains(github.event.pull_request.labels.*.name, 'run-gpu-ci') }} | |
| get-envs: | |
| runs-on: ubuntu-latest | |
| needs: check | |
| outputs: | |
| stable-dev: ${{ steps.get-envs.outputs.stable-dev }} | |
| prerelease: ${{ steps.get-envs.outputs.prerelease }} | |
| steps: | |
| - uses: actions/checkout@v6 | |
| with: | |
| filter: blob:none | |
| fetch-depth: 0 | |
| - uses: astral-sh/setup-uv@v6 | |
| with: | |
| enable-cache: false | |
| - id: get-envs | |
| run: | | |
| # Stable and dev environments | |
| STABLE_DEV_JSON=$(uvx --with "virtualenv<21" hatch env show --json | jq -c ' | |
| to_entries | |
| | map( | |
| select(.key | startswith("hatch-test") and endswith("12") and (contains("prerelease") | not)) | |
| | { | |
| name: .key, | |
| python: .value.python | sub("3[.]13"; "3.13.3"), | |
| } | |
| )') | |
| echo "stable-dev=${STABLE_DEV_JSON}" | tee -a $GITHUB_OUTPUT | |
| # Prerelease environments | |
| PRERELEASE_JSON=$(uvx --with "virtualenv<21" hatch env show --json | jq -c ' | |
| to_entries | |
| | map( | |
| select(.key | startswith("hatch-test") and endswith("12") and contains("prerelease")) | |
| | { | |
| name: .key, | |
| python: .value.python | sub("3[.]13"; "3.13.3"), | |
| } | |
| )') | |
| echo "prerelease=${PRERELEASE_JSON}" | tee -a $GITHUB_OUTPUT | |
| test-stable-dev: | |
| name: Test (${{ matrix.env.name }}) | |
| needs: get-envs | |
| runs-on: cirun-aws-gpu | |
| timeout-minutes: 30 | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| env: ${{ fromJson(needs.get-envs.outputs.stable-dev) }} | |
| env: | |
| ENV_NAME: ${{ matrix.env.name }} | |
| steps: | |
| - uses: actions/checkout@v6 | |
| with: | |
| fetch-depth: 0 | |
| filter: blob:none | |
| - uses: astral-sh/setup-uv@v6 | |
| with: | |
| python-version: ${{ matrix.env.python }} | |
| - name: Add CUDA to PATH | |
| run: | | |
| echo "/usr/local/cuda/bin" >> $GITHUB_PATH | |
| echo "LD_LIBRARY_PATH=/usr/local/cuda/lib64${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}" >> $GITHUB_ENV | |
| - name: Install dependencies | |
| run: uvx --with "virtualenv<21" hatch -v env create ${{ matrix.env.name }} | |
| - name: Run tests | |
| run: | | |
| mkdir -p test-data | |
| if [[ "${{ matrix.env.name }}" == *"stable"* ]]; then | |
| uvx --with "virtualenv<21" hatch run ${{ matrix.env.name }}:run-cov -v --color=yes | |
| uvx --with "virtualenv<21" hatch run ${{ matrix.env.name }}:coverage xml | |
| uvx --with "virtualenv<21" hatch run ${{ matrix.env.name }}:cov-report | |
| else | |
| uvx --with "virtualenv<21" hatch run ${{ matrix.env.name }}:run -v --color=yes | |
| fi | |
| - name: Upload test results | |
| if: ${{ !cancelled() && contains(matrix.env.name, 'stable') }} | |
| uses: codecov/codecov-action@v5 | |
| with: | |
| report_type: test_results | |
| files: test-data/test-results.xml | |
| use_oidc: false | |
| fail_ci_if_error: false | |
| token: ${{ secrets.CODECOV_TOKEN }} | |
| - name: Upload coverage data | |
| if: contains(matrix.env.name, 'stable') | |
| uses: codecov/codecov-action@v5 | |
| with: | |
| files: test-data/coverage.xml | |
| use_oidc: false | |
| fail_ci_if_error: false | |
| token: ${{ secrets.CODECOV_TOKEN }} | |
| test-prerelease: | |
| name: Test (${{ matrix.env.name }}) | |
| needs: get-envs | |
| runs-on: cirun-aws-gpu | |
| timeout-minutes: 30 | |
| continue-on-error: true # Prerelease failures don't fail the workflow | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| env: ${{ fromJson(needs.get-envs.outputs.prerelease) }} | |
| env: | |
| ENV_NAME: ${{ matrix.env.name }} | |
| steps: | |
| - uses: actions/checkout@v6 | |
| with: | |
| fetch-depth: 0 | |
| filter: blob:none | |
| - uses: astral-sh/setup-uv@v6 | |
| with: | |
| python-version: ${{ matrix.env.python }} | |
| - name: Add CUDA to PATH | |
| run: | | |
| echo "/usr/local/cuda/bin" >> $GITHUB_PATH | |
| echo "LD_LIBRARY_PATH=/usr/local/cuda/lib64${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}" >> $GITHUB_ENV | |
| - name: Check CUDA version | |
| run: nvcc --version | |
| - name: Check NVIDIA SMI | |
| run: nvidia-smi | |
| - name: Install dependencies | |
| run: uvx --with "virtualenv<21" hatch -v env create ${{ matrix.env.name }} | |
| - name: Run tests | |
| run: uvx --with "virtualenv<21" hatch run ${{ matrix.env.name }}:run -v --color=yes | |
| remove-label: | |
| name: Remove 'run-gpu-ci' Label | |
| runs-on: ubuntu-latest | |
| if: ${{ always() && github.event_name == 'pull_request' && contains(github.event.pull_request.labels.*.name, 'run-gpu-ci') }} | |
| steps: | |
| - uses: actions-ecosystem/action-remove-labels@v1 | |
| with: | |
| labels: 'run-gpu-ci' | |
| github_token: ${{ secrets.GITHUB_TOKEN }} | |
| stable-dev-green: | |
| name: CI-Pass | |
| if: always() | |
| needs: | |
| - get-envs | |
| - test-stable-dev | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: re-actors/alls-green@release/v1 | |
| with: | |
| jobs: ${{ toJSON(needs) }} | |
| all-green: | |
| name: All Tests Green | |
| if: always() | |
| needs: | |
| - get-envs | |
| - test-stable-dev | |
| - test-prerelease | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: re-actors/alls-green@release/v1 | |
| with: | |
| allowed-failures: test-prerelease | |
| jobs: ${{ toJSON(needs) }} |