fix a test #92
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: PR Tests | |
on: | |
push: | |
branches: | |
- "pull-request/[0-9]+" | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
jobs: | |
check-changes: | |
if: github.repository == 'NVIDIA/tilus' | |
runs-on: ubuntu-latest | |
outputs: | |
should_run_tests: ${{ steps.changed-tests.outputs.any_changed }} | |
should_run_examples: ${{ steps.changed-examples.outputs.any_changed }} | |
should_run_docs: ${{ steps.changed-docs.outputs.any_changed }} | |
steps: | |
- name: Checkout Repository | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Check for changes in test-relevant directories | |
id: changed-tests | |
uses: step-security/changed-files@v46 | |
with: | |
files: | | |
tests/** | |
python/** | |
pyproject.toml | |
base_sha: 'origin/main' | |
- name: Check for changes in examples | |
id: changed-examples | |
uses: step-security/changed-files@v46 | |
with: | |
files: | | |
python/** | |
examples/** | |
pyproject.toml | |
base_sha: 'origin/main' | |
- name: Check for changes in docs | |
id: changed-docs | |
uses: step-security/changed-files@v46 | |
with: | |
files: | | |
python/** | |
docs/** | |
pyproject.toml | |
base_sha: 'origin/main' | |
tests: | |
needs: check-changes | |
if: github.repository == 'NVIDIA/tilus' && needs.check-changes.outputs.should_run_tests == 'true' | |
continue-on-error: true | |
strategy: | |
matrix: | |
runner: | |
- linux-amd64-gpu-l4-latest-1 | |
runs-on: ${{ matrix.runner }} | |
container: | |
image: nvidia/cuda:12.6.2-devel-ubuntu22.04 | |
options: --gpus all | |
steps: | |
- name: Checkout Repository | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Setup and Install Tilus | |
id: setup-and-install | |
uses: ./.github/actions/setup-environment | |
with: | |
python-version: '3.10' | |
- name: Run tests | |
run: pytest ./tests | |
docs: | |
needs: check-changes | |
if: github.repository == 'NVIDIA/tilus' && needs.check-changes.outputs.should_run_docs == 'true' | |
runs-on: linux-amd64-gpu-l4-latest-1 | |
container: | |
image: nvidia/cuda:12.6.2-devel-ubuntu22.04 | |
options: --gpus all | |
steps: | |
- name: Checkout Repository | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Setup and Install Tilus | |
id: setup-and-install | |
uses: ./.github/actions/setup-environment | |
with: | |
python-version: '3.10' | |
- name: Build docs | |
run: | | |
cd docs | |
make html | |
examples: | |
needs: check-changes | |
if: github.repository == 'NVIDIA/tilus' && needs.check-changes.outputs.should_run_examples == 'true' | |
runs-on: linux-amd64-gpu-l4-latest-1 | |
container: | |
image: nvidia/cuda:12.6.2-devel-ubuntu22.04 | |
options: --gpus all | |
steps: | |
- name: Checkout Repository | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Setup and Install Tilus | |
id: setup-and-install | |
uses: ./.github/actions/setup-environment | |
with: | |
python-version: '3.10' | |
- name: Install example dependencies | |
run: | | |
pip install wheel | |
pip install flash-attn --no-build-isolation | |
- name: Run examples | |
run: | | |
bash .github/workflows/scripts/run-examples.sh | |
all-functional-tests: | |
name: All Functional Tests | |
needs: [tests, docs, examples] | |
if: always() && github.repository == 'NVIDIA/tilus' | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check job results | |
run: | | |
echo "Tests result: ${{ needs.tests.result }}" | |
echo "Docs result: ${{ needs.docs.result }}" | |
echo "Examples result: ${{ needs.examples.result }}" | |
# Check if any required job failed | |
if [[ "${{ needs.tests.result }}" == "failure" ]] || [[ "${{ needs.docs.result }}" == "failure" ]] || [[ "${{ needs.examples.result }}" == "failure" ]]; then | |
echo "One or more functional tests failed" | |
exit 1 | |
elif [[ "${{ needs.tests.result }}" == "cancelled" ]] || [[ "${{ needs.docs.result }}" == "cancelled" ]] || [[ "${{ needs.examples.result }}" == "cancelled" ]]; then | |
echo "One or more functional tests were cancelled" | |
exit 1 | |
else | |
echo "All functional tests passed or were skipped" | |
fi |