test : push a WRONG data and then try PR #4
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: Test CMIP6 CVs with esgvoc | |
| on: | |
| pull_request: | |
| branches: [ esgvoc ] | |
| push: | |
| branches: [ esgvoc ] | |
| jobs: | |
| validate-cvs: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout CMIP6_CVs | |
| uses: actions/checkout@v4 | |
| with: | |
| # This ensures we test the exact commit from the PR | |
| ref: ${{ github.event.pull_request.head.sha || github.sha }} | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.11' | |
| - name: Install uv | |
| run: curl -LsSf https://astral.sh/uv/install.sh | sh | |
| - name: Add uv to PATH | |
| run: echo "$HOME/.cargo/bin" >> $GITHUB_PATH | |
| - name: Create test environment and install esgvoc | |
| run: | | |
| uv venv | |
| source .venv/bin/activate | |
| uv pip install esgvoc | |
| - name: Run esgvoc CV tests | |
| env: | |
| # The repo URL (GitHub Actions is already in the repo) | |
| REPO_URL: ${{ github.server_url }}/${{ github.repository }} | |
| # The branch/commit being tested | |
| TEST_BRANCH: ${{ github.head_ref || github.ref_name }} | |
| # Universe branch (use esgvoc stable branch) | |
| UNIVERSE_BRANCH: esgvoc | |
| # Project name | |
| PROJECT_NAME: cmip6 | |
| run: | | |
| source .venv/bin/activate | |
| echo "Testing CMIP6 CVs..." | |
| echo "Repository: $REPO_URL" | |
| echo "Branch: $TEST_BRANCH" | |
| echo "Universe Branch: $UNIVERSE_BRANCH" | |
| # Run complete test suite | |
| esgvoc test run cmip6 \ | |
| --repo "$REPO_URL" \ | |
| --branch "$TEST_BRANCH" \ | |
| --universe-branch "$UNIVERSE_BRANCH" | |
| - name: Test Summary | |
| if: always() | |
| run: | | |
| if [ $? -eq 0 ]; then | |
| echo "✅ All CV validations passed!" | |
| else | |
| echo "❌ CV validation failed. Check logs above for details." | |
| exit 1 | |
| fi |