Don't rewrite a search prefix when attempting a suggestion #2677
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 | |
| on: | |
| push: | |
| branches: | |
| - 'master' | |
| merge_group: | |
| pull_request: | |
| branches: | |
| - '*' | |
| workflow_dispatch: | |
| jobs: | |
| code-formatting: | |
| runs-on: ubuntu-24.04 | |
| name: Code Formatting | |
| steps: | |
| - uses: actions/checkout@v5 | |
| with: | |
| fetch-depth: 0 | |
| - name: Fetch base ref | |
| if: ${{ github.event.pull_request }} | |
| run: git fetch origin ${{ github.base_ref }}:upstream | |
| - run: npm install | |
| - name: Install Carton | |
| uses: perl-actions/install-with-cpm@v1 | |
| with: | |
| install: Carton | |
| - name: Install CPAN deps | |
| uses: perl-actions/install-with-cpm@v1 | |
| with: | |
| cpanfile: 'cpanfile' | |
| args: > | |
| --resolver=snapshot | |
| --without-runtime | |
| --without-test | |
| --without-build | |
| --with-develop | |
| - name: Install precious | |
| run: ./bin/install-precious /usr/local/bin | |
| env: | |
| GITHUB_TOKEN: ${{ github.token }} | |
| - run: perltidy --version | |
| - name: Select files | |
| id: select-files | |
| run: | | |
| if [[ -n "${{ github.event.pull_request.number }}" ]]; then | |
| echo 'precious-args=--git-diff-from upstream' >> "$GITHUB_OUTPUT" | |
| else | |
| echo 'precious-args=--all' >> "$GITHUB_OUTPUT" | |
| fi | |
| - name: Lint files | |
| run: precious lint ${{ steps.select-files.outputs.precious-args }} | |
| docker: | |
| runs-on: ubuntu-24.04 | |
| name: Docker | |
| steps: | |
| - name: Build test image | |
| id: docker-build-test | |
| uses: docker/build-push-action@v6 | |
| with: | |
| target: test | |
| push: false | |
| load: true | |
| - name: Run Perl tests | |
| run: docker run -i ${{ steps.docker-build-test.outputs.imageid }} | |
| playwright: | |
| runs-on: ubuntu-24.04 | |
| name: playwright test | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - name: Build test image | |
| id: docker-build-playwright | |
| uses: docker/build-push-action@v6 | |
| with: | |
| target: playwright | |
| push: false | |
| load: true | |
| - name: Start playwright server | |
| id: start-container | |
| run: > | |
| CONTAINER_ID=$(docker run -d -i -p 8000:80 | |
| -v $(pwd):/app | |
| ${{ steps.docker-build-playwright.outputs.imageid }}) | |
| && echo "container_id=$CONTAINER_ID" >> $GITHUB_OUTPUT | |
| || (echo "Failed to start container" && exit 1) | |
| - uses: actions/setup-node@v5 | |
| with: | |
| node-version: 22 | |
| - name: Install Playwright Browsers | |
| run: ./bin/install-playwright | |
| - name: Install Codecovbash | |
| uses: perl-actions/install-with-cpm@v1 | |
| with: | |
| install: | | |
| Devel::Cover | |
| Devel::Cover::Report::Codecovbash | |
| sudo: true | |
| - name: Check docker status | |
| id: playwright-tests | |
| run: | | |
| npx playwright test || { | |
| echo "Playwright tests failed" | |
| docker logs ${{ steps.start-container.outputs.container_id }} | |
| exit 1 | |
| } | |
| - name: Run Playwright tests | |
| run: npx playwright test | |
| - name: Generate Codecov report | |
| run: cover -report codecovbash | |
| - uses: codecov/codecov-action@v5 | |
| with: | |
| fail_ci_if_error: true | |
| file: ./cover_db/codecov.json | |
| token: ${{ secrets.CODECOV_TOKEN }} | |
| test: | |
| runs-on: ubuntu-24.04 | |
| name: Dockerless | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| perl-version: | |
| - '5.36' | |
| resolver: | |
| - snapshot | |
| - metacpan | |
| container: | |
| image: perl:${{ matrix.perl-version }} | |
| env: | |
| DEVEL_COVER_OPTIONS: '+ignore,^local/,^t/' | |
| steps: | |
| - name: Enable coverage | |
| id: coverage | |
| if: > | |
| matrix.resolver == 'snapshot' | |
| && github.event.pull_request.user.login != 'dependabot[bot]' | |
| run: echo "enabled=1" >> "$GITHUB_OUTPUT" | |
| - uses: actions/checkout@v5 | |
| - uses: actions/setup-node@v5 | |
| with: | |
| node-version: '22' | |
| - run: npm install | |
| - run: apt-get update && apt-get -y install libcmark-dev | |
| - name: Install Carton | |
| uses: perl-actions/install-with-cpm@v1 | |
| with: | |
| install: Carton | |
| sudo: false | |
| - name: Install CPAN deps | |
| uses: perl-actions/install-with-cpm@v1 | |
| with: | |
| cpanfile: 'cpanfile' | |
| sudo: false | |
| args: > | |
| --resolver ${{ matrix.resolver }} | |
| - name: Build assets | |
| run: npm run build | |
| - name: Install Codecovbash | |
| if: steps.coverage.outputs.enabled | |
| uses: perl-actions/install-with-cpm@v1 | |
| with: | |
| install: | | |
| Devel::Cover | |
| Devel::Cover::Report::Codecovbash | |
| sudo: false | |
| - name: Enable coverage | |
| if: steps.coverage.outputs.enabled | |
| run: echo "HARNESS_PERL_SWITCHES=-MDevel::Cover" >> "$GITHUB_ENV" | |
| - name: Run tests | |
| run: carton exec prove -lr --jobs 2 t | |
| - name: Generate Codecov report | |
| if: steps.coverage.outputs.enabled | |
| run: cover -report codecovbash | |
| - uses: codecov/codecov-action@v5 | |
| if: steps.coverage.outputs.enabled | |
| with: | |
| fail_ci_if_error: true | |
| file: ./cover_db/codecov.json | |
| token: ${{ secrets.CODECOV_TOKEN }} |