update dependencies #81
This file contains 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: Build and test | |
on: | |
push: | |
branches: | |
- master | |
env: | |
SERVICE_ACCOUNT: ${{ secrets.SERVICE_ACCOUNT }} | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
timeout-minutes: 5 | |
env: | |
NODE_VERSION: 20 | |
steps: | |
- name: Сheckout repo | |
uses: actions/checkout@v3 | |
- name: Use Node.js ${{ env.NODE_VERSION }} | |
uses: actions/setup-node@v3 | |
with: | |
node-version: ${{ env.NODE_VERSION }} | |
- name: Cache node modules | |
uses: actions/cache@v3 | |
env: | |
cache-name: cache-node-modules | |
with: | |
path: ~/.npm | |
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }} | |
restore-keys: | | |
${{ runner.os }}-build-${{ env.cache-name }}- | |
${{ runner.os }}-build- | |
${{ runner.os }}- | |
- name: Install dependencies | |
run: npm ci | |
- name: Run linter | |
run: npm run lint | |
- name: Run builder | |
run: npm run build | |
- name: Archiving lib directory | |
uses: actions/upload-artifact@v3 | |
with: | |
name: lib | |
path: ${{ github.workspace }}/lib | |
retention-days: 1 | |
node14: | |
runs-on: ubuntu-latest | |
timeout-minutes: 15 | |
needs: [build] | |
env: | |
NODE_VERSION: 14 | |
steps: | |
- name: Сheckout repo | |
uses: actions/checkout@v3 | |
- name: Unarchiving lib directory | |
uses: actions/download-artifact@v3 | |
with: | |
name: lib | |
path: ${{ github.workspace }}/lib | |
- name: Use Node.js ${{ env.NODE_VERSION }} | |
uses: actions/setup-node@v3 | |
with: | |
node-version: ${{ env.NODE_VERSION }} | |
- name: Cache node modules | |
uses: actions/cache@v3 | |
env: | |
cache-name: cache-node-modules | |
with: | |
path: ~/.npm | |
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }} | |
restore-keys: | | |
${{ runner.os }}-build-${{ env.cache-name }}- | |
${{ runner.os }}-build- | |
${{ runner.os }}- | |
- name: Install dependencies | |
run: npm ci | |
- name: Install emulator and test library | |
run: sudo npm install firebase-tools -g | |
- name: Set service account | |
run: echo $SERVICE_ACCOUNT>serviceAccount.json | |
- name: Run emulator | |
run: npm run cov | |
node16: | |
runs-on: ubuntu-latest | |
timeout-minutes: 15 | |
needs: [build, node14] | |
env: | |
NODE_VERSION: 16 | |
steps: | |
- name: Сheckout repo | |
uses: actions/checkout@v3 | |
- name: Unarchiving lib directory | |
uses: actions/download-artifact@v3 | |
with: | |
name: lib | |
path: ${{ github.workspace }}/lib | |
- name: Use Node.js ${{ env.NODE_VERSION }} | |
uses: actions/setup-node@v3 | |
with: | |
node-version: ${{ env.NODE_VERSION }} | |
- name: Cache node modules | |
uses: actions/cache@v3 | |
env: | |
cache-name: cache-node-modules | |
with: | |
path: ~/.npm | |
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }} | |
restore-keys: | | |
${{ runner.os }}-build-${{ env.cache-name }}- | |
${{ runner.os }}-build- | |
${{ runner.os }}- | |
- name: Install dependencies | |
run: npm ci | |
- name: Install emulator and test library | |
run: sudo npm install firebase-tools -g | |
- name: Set service account | |
run: echo $SERVICE_ACCOUNT>serviceAccount.json | |
- name: Run emulator | |
run: npm run cov | |
# node18: | |
# runs-on: ubuntu-latest | |
# timeout-minutes: 15 | |
# needs: [build, node14, node16] | |
# env: | |
# NODE_VERSION: 18 | |
# steps: | |
# - name: Сheckout repo | |
# uses: actions/checkout@v3 | |
# - name: Unarchiving lib directory | |
# uses: actions/download-artifact@v3 | |
# with: | |
# name: lib | |
# path: ${{ github.workspace }}/lib | |
# - name: Use Node.js ${{ env.NODE_VERSION }} | |
# uses: actions/setup-node@v3 | |
# with: | |
# node-version: ${{ env.NODE_VERSION }} | |
# - name: Cache node modules | |
# uses: actions/cache@v3 | |
# env: | |
# cache-name: cache-node-modules | |
# with: | |
# path: ~/.npm | |
# key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }} | |
# restore-keys: | | |
# ${{ runner.os }}-build-${{ env.cache-name }}- | |
# ${{ runner.os }}-build- | |
# ${{ runner.os }}- | |
# - name: Install dependencies | |
# run: npm ci | |
# - name: Install emulator and test library | |
# run: sudo npm install firebase-tools -g | |
# - name: Set service account | |
# run: echo $SERVICE_ACCOUNT>serviceAccount.json | |
# - name: Run emulator | |
# run: npm run cov |