Repository navigation
Move the in-repo packages to tsup 9 #12
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: Test | |
| # ユニットテストのゲート。 | |
| # | |
| # これまで CI は api-surface.yml(公開 API の凍結)と deploy 系だけで、 | |
| # **テストを走らせるワークフローが 1 つも無かった。** 凍結ゲートが見るのは | |
| # 型の形だけなので、シグネチャが同じまま中身が壊れる変更は素通りする。 | |
| # | |
| # ブラウザを要する検証はここには入れない。`npm run smoke` は実 Chrome で | |
| # 全プロバイダを描画するもので、API キーと数分の実行時間を要する。CI に載せる | |
| # なら別ワークフロー・別トリガにすること。 | |
| on: | |
| pull_request: | |
| types: [opened, reopened, synchronize, ready_for_review] | |
| branches: | |
| - main | |
| - develop | |
| push: | |
| branches: | |
| - main | |
| - develop | |
| workflow_dispatch: | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| test: | |
| if: github.event.pull_request.draft == false | |
| runs-on: ubuntu-latest | |
| name: Unit tests | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v6 | |
| with: | |
| submodules: recursive | |
| token: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Set up Node | |
| uses: actions/setup-node@v4 | |
| with: | |
| # 各パッケージの `node --test "test/**/*.test.mjs"` は Node 21 からグロブを | |
| # 展開する。20 ではパターンをそのままファイル名として探し、見つからずに落ちる。 | |
| node-version: 22 | |
| cache: npm | |
| - name: Install | |
| run: npm ci | |
| # 各パッケージの `pretest` は自分の dist しか作らない。プロバイダの build は | |
| # js-sdk-react の dist(型と `/internal`)を読むので、それと js-sdk-core だけ先に作る。 | |
| - name: Build shared packages | |
| run: npm run build -w @mapconductor/js-sdk-core -w @mapconductor/js-sdk-react | |
| # ワークスペース横断。各パッケージの `pretest` が自分の dist を作る。 | |
| - name: Test | |
| run: npm test | |
| - name: Lint | |
| run: npm run lint |