v5.6.0-alpha.0 #3151
Workflow file for this run
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: Test | |
on: push | |
jobs: | |
run-tests: | |
name: Run tests | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
# The first item in the matrix should be the minimal supported SDK version, the last item should be the latest supported version. | |
# You should include any major releases that could potentially break the compatibility in between. | |
# Please keep this in sync with the peer dependency version and with the typecheck.yml workflow. | |
sdk-version: [ 12, 14, 15 ] # v13 is just an intermediary version, so we skip it. Current latest version is v15. | |
steps: | |
- name: Check out Git repository | |
uses: actions/checkout@v3 | |
- name: Use Node.js | |
uses: actions/setup-node@v3 | |
with: | |
node-version-file: '.nvmrc' | |
- name: Cache node modules | |
uses: actions/cache@v3 | |
env: | |
cache-name: cache-node-modules | |
with: | |
path: "**/node_modules" | |
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ matrix.sdk-version }}-${{ hashFiles('**/package-lock.json') }} | |
restore-keys: | | |
${{ runner.os }}-build-${{ env.cache-name }}-${{ matrix.sdk-version }}- | |
${{ runner.os }}-build-${{ env.cache-name }}- | |
${{ runner.os }}-build- | |
${{ runner.os }}- | |
- name: Install Node.js dependencies | |
run: npm ci | |
- name: Install SDK ${{ matrix.sdk-version }} | |
env: | |
SDK_VERSION: ${{ matrix.sdk-version }} | |
run: | | |
npm remove @prezly/sdk \ | |
&& npm install @prezly/sdk@${{ matrix.sdk-version }} --save-dev | |
- name: Run tests | |
run: npm test |