Automatic resources update #168
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: Update Labs Engine cache | |
| on: | |
| pull_request: | |
| types: [closed] | |
| branches: | |
| - main | |
| jobs: | |
| update_cache: | |
| if: github.event.pull_request.merged == true | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v6 | |
| with: | |
| fetch-depth: 0 | |
| - name: Get list of changed files | |
| run: | | |
| BASE=${{ github.event.pull_request.base.sha }} | |
| HEAD=${{ github.event.pull_request.merge_commit_sha }} | |
| git diff --name-only $BASE $HEAD | grep "^communities/[^/]\+/lab" > paths.txt || true | |
| echo "" | |
| echo "Changed files:" | |
| cat paths.txt | |
| - name: Test changed Lab pages | |
| id: test-labs | |
| env: | |
| BRANCH_NAME: main | |
| HEAD_REPO: ${{ github.event.pull_request.base.repo.full_name }} | |
| run: | | |
| if [ -s paths.txt ]; then | |
| echo "Changed files found. Updating Labs Engine cache and running tests..." | |
| ln -s . head # script expects repo to be here | |
| python3 sources/bin/labs_test.py paths.txt | |
| else | |
| echo "No changes to Galaxy Labs found" | |
| fi | |
| continue-on-error: true | |
| - name: Check outcome of the previous step | |
| id: check-outcome | |
| run: | | |
| if [ "${{ steps.test-labs.outcome }}" == "failure" ]; then | |
| echo "Test failed" | |
| exit 1 | |
| else | |
| echo "Test passed" | |
| fi |