[github-actions]: bump changesets/action from 1.8.0 to 1.9.0 #61
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: Node CI | |
| on: | |
| push: | |
| branches: [master] | |
| pull_request: | |
| types: [opened, synchronize, reopened, ready_for_review] | |
| permissions: | |
| contents: read | |
| concurrency: | |
| group: ci-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| if: github.event.pull_request.draft == false | |
| steps: | |
| - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| - uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0 | |
| with: | |
| node-version-file: '.nvmrc' | |
| - name: Install pnpm | |
| run: | | |
| npm install --global corepack@latest | |
| corepack enable | |
| corepack install | |
| - name: Install dependencies | |
| run: pnpm install --frozen-lockfile | |
| - name: Type check | |
| run: pnpm type-check | |
| - name: Lint | |
| run: pnpm lint | |
| - name: Format check | |
| run: pnpm format:check | |
| - name: Build | |
| run: pnpm build | |
| - name: Test | |
| run: pnpm test | |
| - name: Verify ESM output | |
| run: | | |
| node -e " | |
| import('fs').then(fs => { | |
| const esm = fs.readFileSync('./lib/index.js', 'utf8'); | |
| if (!esm.includes('GoogleCloudDatabase') || !esm.includes('GoogleCloudStorageHandler')) process.exit(1); | |
| if (!esm.includes('export {')) process.exit(1); | |
| console.log('ESM bundle verified'); | |
| }); | |
| " | |
| docker: | |
| runs-on: ubuntu-latest | |
| needs: build | |
| if: github.event_name == 'pull_request' | |
| steps: | |
| - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| - uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0 | |
| with: | |
| node-version-file: '.nvmrc' | |
| - name: Install pnpm | |
| run: | | |
| npm install --global corepack@latest | |
| corepack enable | |
| corepack install | |
| - name: Install dependencies | |
| run: pnpm install --frozen-lockfile | |
| - name: Build Docker image | |
| run: docker compose build verdaccio | |
| - name: Start services | |
| run: docker compose up -d | |
| - name: Wait for Verdaccio | |
| run: | | |
| for i in $(seq 1 30); do | |
| curl -sf http://localhost:4873/-/ping > /dev/null 2>&1 && echo "Verdaccio ready" && exit 0 | |
| sleep 2 | |
| done | |
| docker compose logs verdaccio | |
| exit 1 | |
| - name: Verify plugin loaded | |
| run: | | |
| # Give verdaccio a moment to log all startup messages | |
| sleep 5 | |
| docker compose logs verdaccio 2>&1 | |
| docker compose logs verdaccio 2>&1 | grep -q "google-cloud" | |
| - name: E2E - publish and fetch a package | |
| run: | | |
| TOKEN=$(curl -sf -X PUT http://localhost:4873/-/user/org.couchdb.user:test \ | |
| -H 'Content-Type: application/json' \ | |
| -d '{"name":"test","password":"test1234"}' | node -e " | |
| process.stdin.setEncoding('utf8'); | |
| let d=''; | |
| process.stdin.on('data',c=>d+=c); | |
| process.stdin.on('end',()=>console.log(JSON.parse(d).token))") | |
| TMPDIR=$(mktemp -d) | |
| echo '{"name":"ci-test-pkg","version":"1.0.0"}' > "$TMPDIR/package.json" | |
| cd "$TMPDIR" | |
| npm publish --registry http://localhost:4873 --//localhost:4873/:_authToken="$TOKEN" | |
| RESULT=$(curl -sf http://localhost:4873/ci-test-pkg | node -e " | |
| process.stdin.setEncoding('utf8'); | |
| let d=''; | |
| process.stdin.on('data',c=>d+=c); | |
| process.stdin.on('end',()=>console.log(JSON.parse(d).name))") | |
| [ "$RESULT" = "ci-test-pkg" ] && echo "E2E passed" || { echo "E2E failed"; exit 1; } | |
| - name: Stop services | |
| if: always() | |
| run: docker compose down -v |