Repository navigation
test: run full browser suite on Endform with one backend job #14
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: "JS Licenses checker" | |
| on: | |
| pull_request: | |
| branches: | |
| - "**" | |
| # labeled/unlabeled so adding or removing 'ready-for-ci' starts or resets CI; drafts never run paid CI. | |
| types: [opened, reopened, synchronize, labeled, unlabeled, ready_for_review, converted_to_draft] | |
| # paths-ignore: | |
| # - "**.md" | |
| # - "**.yml" | |
| # - "**.yaml" | |
| merge_group: | |
| permissions: | |
| contents: read | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.event.merge_group.head_ref || github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| js-license-check: | |
| # Paid CI runs only on PRs carrying the 'ready-for-ci' label; the merge queue runs unit tests on the merged code. | |
| if: ${{ github.event_name != 'pull_request' || (contains(github.event.pull_request.labels.*.name, 'ready-for-ci') && github.event.pull_request.draft == false) }} | |
| runs-on: ubicloud-standard-4 | |
| timeout-minutes: 10 | |
| steps: | |
| - name: Checkout latest code | |
| uses: actions/checkout@v5 | |
| with: | |
| fetch-depth: 0 | |
| - name: Determine base ref | |
| id: base_ref | |
| run: | | |
| if [ "${{ github.event_name }}" = "merge_group" ]; then | |
| echo "base=${{ github.event.merge_group.base_sha }}" >> $GITHUB_OUTPUT | |
| elif [ -n "${{ github.event.before }}" ]; then | |
| echo "base=${{ github.event.before }}" >> $GITHUB_OUTPUT | |
| else | |
| echo "base=origin/${{ github.base_ref || 'main' }}" >> $GITHUB_OUTPUT | |
| fi | |
| - name: Check if UI code has changes | |
| id: check_changes | |
| run: | | |
| if git diff --name-only ${{ steps.base_ref.outputs.base }} ${{ github.sha }} | grep -q "^web/"; then | |
| echo "has_changes=true" >> $GITHUB_OUTPUT | |
| else | |
| echo "has_changes=false" >> $GITHUB_OUTPUT | |
| fi | |
| - name: Check if package files changed | |
| id: check_package_changes | |
| if: steps.check_changes.outputs.has_changes == 'true' | |
| run: | | |
| if git diff --name-only ${{ steps.base_ref.outputs.base }} ${{ github.sha }} | grep -q "package.*.json"; then | |
| echo "has_package_changes=true" >> $GITHUB_OUTPUT | |
| else | |
| echo "has_package_changes=false" >> $GITHUB_OUTPUT | |
| fi | |
| - uses: actions/setup-node@v7 | |
| if: steps.check_changes.outputs.has_changes == 'true' && steps.check_package_changes.outputs.has_package_changes == 'true' | |
| with: | |
| node-version: 24 | |
| - name: Install dependencies | |
| if: steps.check_changes.outputs.has_changes == 'true' && steps.check_package_changes.outputs.has_package_changes == 'true' | |
| run: cd web && npm ci | |
| - name: Check licenses | |
| if: steps.check_changes.outputs.has_changes == 'true' && steps.check_package_changes.outputs.has_package_changes == 'true' | |
| run: | | |
| npm install -g license-checker | |
| cd web && license-checker --production --json --onlyAllow="MIT;ISC;Apache-2.0;BSD;MPL-2.0;Unlicense;CC0-1.0;CC-BY-4.0;Artistic-2.0;UNLICENSED;Python-2.0;BlueOak-1.0.0" |