Fix #32 #203
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 | |
| on: | |
| push: | |
| branches: | |
| # The branch where the project source code resides | |
| # 项目源代码所在的分支 | |
| - main | |
| paths-ignore: | |
| # Changes involving the following path files will not trigger the workflow | |
| # 涉及以下路径文件的更改不会触发工作流 | |
| - LICENSE | |
| - README.md | |
| - README-cmn_CN.md | |
| - README-cmn_TW.md | |
| - README-jyut.md | |
| - docs/** | |
| pull_request: | |
| branches: | |
| - main | |
| paths-ignore: | |
| - LICENSE.txt | |
| - README.md | |
| - README-cmn_CN.md | |
| - README-cmn_TW.md | |
| - README-jyut.md | |
| - docs/** | |
| jobs: | |
| test: | |
| name: Test | |
| strategy: | |
| matrix: | |
| os: [ubuntu-latest, windows-latest] | |
| fail-fast: false | |
| runs-on: ${{ matrix.os }} | |
| timeout-minutes: 10 | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: oven-sh/setup-bun@v2 | |
| with: | |
| bun-version: 1.3.14 | |
| - name: Install dependencies | |
| run: bun install --frozen-lockfile | |
| - name: Lint | |
| if: ${{ matrix.os == 'ubuntu-latest' }} | |
| run: bun run lint | |
| - name: Type check | |
| if: ${{ matrix.os == 'ubuntu-latest' }} | |
| run: bun run typecheck | |
| - name: Test | |
| run: bun run test | |
| - name: Knip | |
| if: ${{ matrix.os == 'ubuntu-latest' }} | |
| run: bun run knip | |
| - name: Build Chromium extension | |
| run: bun run build | |
| - name: Upload zip | |
| if: ${{ matrix.os == 'ubuntu-latest' && github.ref_name == 'main' }} | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| name: extension | |
| path: extension | |
| - name: Build Firefox extension | |
| run: bun run build-firefox | |
| - name: Upload zip | |
| if: ${{ matrix.os == 'ubuntu-latest' && github.ref_name == 'main' }} | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| name: extension-firefox | |
| path: extension-firefox |