CI: Avoid running twice for internal PRs #10
Workflow file for this run
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: CI Syntax Tests | ||
| on: | ||
| push: | ||
| branches: | ||
| - '**' | ||
| tags-ignore: | ||
| - '**' | ||
| paths: | ||
| - '.github/workflows/ci-syntax-tests.yml' | ||
| - '**.sublime-syntax' | ||
| - '**/syntax_test_*' | ||
| pull_request: | ||
| branches: | ||
| - main | ||
| paths: | ||
| - '.github/workflows/ci-syntax-tests.yml' | ||
| - '**.sublime-syntax' | ||
| - '**/syntax_test_*' | ||
| workflow_dispatch: | ||
| env: | ||
| # Run for PR only if it's from a different repository | ||
| # because otherwise we're running each job twice. | ||
| SHOULD_RUN: ${{ github.event_name != 'pull_request' || github.event.pull_request.base.repo.clone_url != github.event.pull_request.head.repo.clone_url}} | ||
| jobs: | ||
| syntax_tests: | ||
| name: Sublime Text ${{ matrix.build }} | ||
| if: ${{ env.SHOULD_RUN }} | ||
|
Check failure on line 30 in .github/workflows/ci-syntax-tests.yml
|
||
| runs-on: ubuntu-latest | ||
| timeout-minutes: 15 # default is 6 hours! | ||
| strategy: | ||
| matrix: | ||
| include: | ||
| # Stable ST4 builds | ||
| - build: 4107 | ||
| default_packages: v4107 | ||
| - build: 4126 | ||
| default_packages: v4126 | ||
| - build: 4143 | ||
| default_packages: v4143 | ||
| - build: 4152 | ||
| default_packages: v4152 | ||
| - build: 4169 | ||
| default_packages: v4169 | ||
| - build: 4180 | ||
| default_packages: v4180 | ||
| # Latest dev build | ||
| - build: latest | ||
| default_packages: master | ||
| steps: | ||
| - name: Checkout Vue | ||
| uses: actions/checkout@v4 | ||
| with: | ||
| path: Vue | ||
| - name: Prepare dummy syntaxes | ||
| run: | | ||
| scopes=( | ||
| source.coffee | ||
| source.livescript | ||
| source.less | ||
| source.postcss | ||
| source.sass | ||
| source.scss | ||
| source.sss | ||
| source.stylus | ||
| text.jade | ||
| text.pug | ||
| text.slm | ||
| text.slim | ||
| ) | ||
| mkdir -vp "Dummy" | ||
| for scope in ${scopes[@]}; do | ||
| cat << SYNTAX > "Dummy/$scope.sublime-syntax" | ||
| %YAML 1.2 | ||
| --- | ||
| scope: $scope | ||
| contexts: | ||
| main: [] | ||
| SYNTAX | ||
| done | ||
| - uses: SublimeText/syntax-test-action@v2 | ||
| with: | ||
| build: ${{ matrix.build }} | ||
| package_name: Vue | ||
| package_root: Vue | ||
| default_packages: ${{ matrix.default_packages }} | ||
| additional_packages: Dummy | ||