Skip to content

Fix z_l->lev rename for OM4 snapshot sources #2601

Fix z_l->lev rename for OM4 snapshot sources

Fix z_l->lev rename for OM4 snapshot sources #2601

Workflow file for this run

# SPDX-FileCopyrightText: 2026 Ocean Emulator Authors
#
# SPDX-License-Identifier: Apache-2.0
name: Test GPU
on:
push:
branches:
- main
pull_request:
branches:
- "**"
workflow_dispatch:
permissions:
id-token: write # Required for interacting with AWS via OIDC
contents: read # Required for actions/checkout (normally set by default, but must explicitly specify when defining a custom `permissions` block.
jobs:
ec2:
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository
uses: Open-Athena/ec2-gha/.github/workflows/runner.yml@v2
with:
ec2_instance_type: g6.xlarge
ec2_image_id: ami-0365bff494b18bf93 # Deep Learning OSS Nvidia Driver AMI GPU PyTorch 2.7 (Ubuntu 22.04) in oa-ci-dev
ec2_root_device_size: "+10" # AMI's reported VolumeSize (40GB) +1GB; leaves headroom for test I/O; instance runs out of disk otherwise
aws_tags: '[{"Key": "project", "Value": "fomo"}]'
secrets:
GH_SA_TOKEN: ${{ secrets.GH_SA_TOKEN }}
test-gpu:
needs: ec2
runs-on: ${{ needs.ec2.outputs.id }}
steps:
- name: Check out code
uses: actions/checkout@v6
# Invalidate the data cache every time the data source changes.
# If an exact cache isn't found, fall back to previous cache.
- name: Cache test data
uses: actions/cache@v3
with:
path: .data_cache/
key: ${{ runner.os }}-test-data-${{ hashFiles('tests/conftest.py', 'configs/test/*.yaml') }}
- name: Install uv and set the python version
uses: astral-sh/setup-uv@v6
with:
enable-cache: true
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Install dependencies
run: uv sync --locked --dev --extra cuda
# Each test runs with a 5-minute timeout. The `-x` flag will stop on the first failure or hang.
- name: Run pytest
run: uv run --with pytest-timeout --locked pytest -n 2 -v -m "not manual and cuda" --timeout=300 --timeout-method=signal -x
timeout-minutes: 30
# This exists beacuse the run-tests job will be skipped if the ec2 job fails,
# and that skip will not block merging the PR.
report-gpu-test-status:
if: always()
needs: [ec2, test-gpu]
runs-on: ubuntu-latest
steps:
- name: Check job results
if: contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled')
run: exit 1
- name: Fail if GPU tests did not run
if: needs['test-gpu'].result == 'skipped'
run: |
echo "AWS-backed GPU tests did not run automatically."
echo "Run this workflow manually from the GitHub Actions UI once the code has been reviewed."
exit 1