Skip to content

Merge pull request #513 from rafaelkallis/dependabot/npm_and_yarn/typ… #1226

Merge pull request #513 from rafaelkallis/dependabot/npm_and_yarn/typ…

Merge pull request #513 from rafaelkallis/dependabot/npm_and_yarn/typ… #1226

Workflow file for this run

name: Continuous Integration
on:
push:
branches: [ prod, beta ]
pull_request:
branches: [ prod, beta ]
jobs:
build:
strategy:
matrix:
ubuntu-version: [ ubuntu-20.04, ubuntu-22.04 ]
node-version: [ 16.x, 18.x ]
runs-on: ${{ matrix.ubuntu-version }}
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Get latest model version
id: get-latest-model-version
shell: bash
env:
model_uri: https://tickettagger.blob.core.windows.net/models/model.bin
# echo "::set-output name=version::$(curl --head '${{ env.model_uri }}' --silent | grep -oP 'ETag: \K0x[0-9A-Fa-f]+')"
run: |
echo "version=$(curl --head '${{ env.model_uri }}' --silent | grep -oP 'ETag: \K0x[0-9A-Fa-f]+')" >> $GITHUB_OUTPUT
- name: Cache model
uses: actions/cache@v3
id: cache-model
with:
path: ~/.tickettagger/models
key: model-${{ steps.get-latest-model-version.outputs.version }}
restore-keys: |
model-
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- name: Cache node_modules
uses: actions/cache@v3
id: cache-node_modules
with:
path: node_modules
key: node_modules-${{ matrix.ubuntu-version }}-${{ matrix.node-version }}-${{ hashFiles('package-lock.json') }}
restore-keys: |
node_modules-${{ matrix.ubuntu-version }}-${{ matrix.node-version }}-
node_modules-${{ matrix.ubuntu-version }}-
node_modules-
- name: Install
if: steps.cache-node_modules.outputs.cache-hit != 'true'
run: npm ci
- name: Test
env:
MONGO_URI: ${{ secrets.MONGO_URI }}
run: npm test