chore: upgrade packages and increase min node versions (#84) #377
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: | |
workflow_dispatch: | |
push: | |
branches: [main] | |
pull_request: | |
branches: [main] | |
jobs: | |
checks: | |
name: TypeScript, lint, build | |
runs-on: [ubuntu-latest] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Setup Node | |
uses: actions/setup-node@v4 | |
with: | |
node-version-file: '.nvmrc' | |
cache: 'yarn' | |
- name: Install dependencies | |
run: yarn install --immutable | |
- name: Check types | |
run: yarn check-types | |
- name: Lint | |
run: yarn lint | |
- name: Build packages | |
run: yarn build | |
tests: | |
name: Tests / Node ${{ matrix.node }} | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [ubuntu-latest] | |
node: ['18', '19', '20', '21'] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Setup Node | |
uses: actions/setup-node@v4 | |
with: | |
cache: 'yarn' | |
node-version: ${{ matrix.node }} | |
- name: Install dependencies | |
run: yarn install --immutable | |
- name: Run tests without coverage | |
run: yarn test | |
coverage-tests: | |
name: Coverage tests / Node ${{ matrix.node }} | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [ubuntu-latest] | |
node: ['18'] | |
# Keep in sync with Jest projects config | |
proj: ['auth-token', 'cli', 'core', 'library', 'utils'] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Setup Node | |
uses: actions/setup-node@v4 | |
with: | |
cache: 'yarn' | |
node-version: ${{ matrix.node }} | |
- name: Install dependencies | |
run: yarn install --immutable | |
- name: Run tests with coverage | |
run: yarn test:pkg ${{ matrix.proj }} --coverage | |
- name: Upload coverage to Codecov | |
uses: codecov/codecov-action@v3 | |
with: | |
fail_ci_if_error: true | |
flags: ${{ matrix.proj }} | |
files: ./coverage/coverage-final.json | |
verbose: true | |
integration: | |
name: Integration tests / Node ${{ matrix.node }} | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [ubuntu-latest] | |
node: ['18'] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Setup Node v${{ matrix.node }} | |
uses: actions/setup-node@v4 | |
with: | |
cache: 'yarn' | |
node-version: ${{ matrix.node }} | |
- name: Install dependencies | |
run: yarn install --immutable | |
- name: Run tests | |
run: > | |
SPOTIFY_CLIENT_ID=${{ secrets.SPOTIFY_CLIENT_ID }} | |
SPOTIFY_CLIENT_SECRET=${{ secrets.SPOTIFY_CLIENT_SECRET }} | |
SPOTIFY_REFRESH_TOKEN=${{ secrets.SPOTIFY_REFRESH_TOKEN }} | |
yarn test:integration |