fix : ids in lower case #5
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: CV Validation with ESGVoc | |
| on: | |
| push: | |
| branches: [ REF, esgvoc, esgvoc_dev ] | |
| permissions: | |
| contents: write | |
| actions: read | |
| env: | |
| TEST_BRANCH: "test_branch_${{ github.run_id }}" | |
| PYTHON_VERSION: "3.11" | |
| # Conditional esgvoc library branch: integration for esgvoc_dev, main for others | |
| ESGVOC_LIBRARY_BRANCH: ${{ github.ref_name == 'esgvoc_dev' && 'integration' || 'main' }} | |
| jobs: | |
| validate-cv: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| token: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Set up Git authentication | |
| run: | | |
| git config --global user.name "github-actions[bot]" | |
| git config --global user.email "github-actions[bot]@users.noreply.github.com" | |
| git remote set-url origin https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }} | |
| - name: Create and push to test branch | |
| run: | | |
| # Create test branch from current commit | |
| git checkout -b ${{ env.TEST_BRANCH }} | |
| # Push test branch to origin | |
| git push origin ${{ env.TEST_BRANCH }} | |
| echo "Test branch created: ${{ env.TEST_BRANCH }}" | |
| echo "TEST_BRANCH_REF=${{ github.repository }}/${{ env.TEST_BRANCH }}" >> $GITHUB_ENV | |
| - name: Set up Python | |
| uses: actions/setup-python@v4 | |
| with: | |
| python-version: ${{ env.PYTHON_VERSION }} | |
| - name: Install uv | |
| run: | | |
| curl -LsSf https://astral.sh/uv/install.sh | sh | |
| echo "$HOME/.local/bin" >> $GITHUB_PATH | |
| - name: Install dependencies | |
| run: | | |
| uv venv | |
| source .venv/bin/activate | |
| # Install esgvoc from the specified branch | |
| uv pip install "esgvoc @ git+https://github.com/ESGF/esgf-vocab.git@${{ env.ESGVOC_LIBRARY_BRANCH }}" | |
| - name: Configure and Install ESGVoc | |
| run: | | |
| source .venv/bin/activate | |
| export TEST_BRANCH="${{ env.TEST_BRANCH }}" | |
| export REPO_URL="https://github.com/${{ github.repository }}" | |
| export ESGVOC_LIBRARY_BRANCH="${{ env.ESGVOC_LIBRARY_BRANCH }}" | |
| python .github/workflows/cv-validate.py configure | |
| - name: Test CV with ESGVoc | |
| run: | | |
| source .venv/bin/activate | |
| python .github/workflows/cv-validate.py test | |
| - name: Cleanup test branch | |
| if: always() | |
| run: | | |
| # Delete the test branch from remote | |
| git push origin --delete ${{ env.TEST_BRANCH }} || true | |
| # Switch back to original branch and delete local test branch | |
| git checkout ${{ github.ref_name }} | |
| git branch -D ${{ env.TEST_BRANCH }} || true | |
| - name: Validation Summary | |
| if: success() | |
| run: | | |
| echo "✅ CV validation completed successfully!" | |
| echo "The changes are compatible with esgvoc library (branch: ${{ env.ESGVOC_LIBRARY_BRANCH }})." | |
| - name: Validation Failed | |
| if: failure() | |
| run: | | |
| echo "❌ CV validation failed!" | |
| echo "Please check the logs above for details." | |
| exit 1 |