Merge pull request #535 from de-luca/dependabot/npm_and_yarn/typescri… #1974
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: CI | |
on: | |
push: | |
branches: | |
- master | |
pull_request: | |
jobs: | |
lint: | |
name: Lint code | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: latest | |
cache: npm | |
- name: Get npm cache directory | |
id: npm-cache-dir | |
shell: bash | |
run: echo "dir=$(npm config get cache)" >> ${GITHUB_OUTPUT} | |
- uses: actions/cache@v3 | |
with: | |
path: ${{ steps.npm-cache-dir.outputs.dir }} | |
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} | |
restore-keys: | | |
${{ runner.os }}-node- | |
- run: npm ci | |
- run: npm run lint | |
test-ubuntu: | |
name: Ubuntu test | |
needs: lint | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: latest | |
cache: npm | |
- name: Get npm cache directory | |
id: npm-cache-dir | |
shell: bash | |
run: echo "dir=$(npm config get cache)" >> ${GITHUB_OUTPUT} | |
- uses: actions/cache@v3 | |
with: | |
path: ${{ steps.npm-cache-dir.outputs.dir }} | |
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} | |
restore-keys: | | |
${{ runner.os }}-node- | |
- run: npm ci | |
- run: xvfb-run --server-args="-screen 0 1024x768x24" npm run test:coverage | |
- uses: codecov/codecov-action@v3 | |
with: | |
token: ${{ secrets.CODECOV_TOKEN }} | |
test-macos: | |
name: macOS test | |
needs: lint | |
runs-on: macos-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: latest | |
cache: npm | |
- name: Get npm cache directory | |
id: npm-cache-dir | |
shell: bash | |
run: echo "dir=$(npm config get cache)" >> ${GITHUB_OUTPUT} | |
- uses: actions/cache@v3 | |
with: | |
path: ${{ steps.npm-cache-dir.outputs.dir }} | |
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} | |
restore-keys: | | |
${{ runner.os }}-node- | |
- run: npm ci | |
- run: npm run test | |
test-windows: | |
name: Windows test | |
needs: lint | |
runs-on: windows-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: latest | |
cache: npm | |
- name: Get npm cache directory | |
id: npm-cache-dir | |
shell: pwsh | |
run: echo "dir=$(npm config get cache)" >> ${env:GITHUB_OUTPUT} | |
- uses: actions/cache@v3 | |
with: | |
path: ${{ steps.npm-cache-dir.outputs.dir }} | |
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} | |
restore-keys: | | |
${{ runner.os }}-node- | |
- run: npm ci | |
- run: npm run test |