|
name: Continuous Integration |
|
|
|
on: pull_request |
|
|
|
permissions: |
|
contents: read |
|
|
|
jobs: |
|
build: |
|
|
|
runs-on: ubuntu-latest |
|
|
|
strategy: |
|
matrix: |
|
node-version: [22.x, 24.x, 26.x] |
|
|
|
steps: |
|
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 |
|
with: |
|
persist-credentials: false |
|
- name: Set up Node.js ${{ matrix.node-version }} |
|
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0 |
|
with: |
|
node-version: ${{ matrix.node-version }} |
|
# Java 21 is required by firebase-tools to run emulator-based integration tests |
|
- name: Set up Java |
|
uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 # v5.2.0 |
|
with: |
|
distribution: 'temurin' |
|
java-version: '21' |
|
- name: Install and build |
|
run: | |
|
npm ci |
|
npm run build |
|
npm run build:tests |
|
- name: Lint and run unit tests |
|
run: npm test |
|
- name: Run api-extractor |
|
run: npm run api-extractor |
|
- name: Run emulator-based integration tests |
|
run: | |
|
npm install -g firebase-tools@15.17.0 |
|
firebase emulators:exec --project fake-project-id --only auth,database,firestore \ |
|
'npx mocha test/integration/auth.spec.ts test/integration/database.spec.ts test/integration/firestore.spec.ts --slow 5000 --timeout 20000 --require ts-node/register' |