Merge pull request #240 from mkreiser/stats #77
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: | |
pull_request: | |
types: [opened, synchronize, reopened] | |
push: | |
branches: [main] | |
jobs: | |
dependencies-cache: | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
node-version: [16, 18, 20] | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: ${{ matrix.node-version }} | |
- run: npm ci | |
- name: Cache node_modules | |
id: cache-node-modules-node | |
uses: actions/cache/save@v3 | |
with: | |
path: '**/node_modules' | |
key: ${{ runner.os }}-node-modules-${{ matrix.node-version }}-${{ hashFiles('package-lock.json') }} | |
lint: | |
runs-on: ubuntu-latest | |
needs: dependencies-cache | |
strategy: | |
fail-fast: false | |
matrix: | |
node-version: [16, 18, 20] | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: ${{ matrix.node-version }} | |
- name: Restore node_modules cache | |
id: restore-cache-node-modules-node | |
uses: actions/cache/restore@v3 | |
with: | |
path: '**/node_modules' | |
key: ${{ runner.os }}-node-modules-${{ matrix.node-version }}-${{ hashFiles('package-lock.json') }} | |
- run: npm run lint | |
test: | |
runs-on: ubuntu-latest | |
needs: dependencies-cache | |
strategy: | |
fail-fast: false | |
matrix: | |
node-version: [16, 18, 20] | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: ${{ matrix.node-version }} | |
- name: Restore node_modules cache | |
id: restore-cache-node-modules-node | |
uses: actions/cache/restore@v3 | |
with: | |
path: '**/node_modules' | |
key: ${{ runner.os }}-node-modules-${{ matrix.node-version }}-${{ hashFiles('package-lock.json') }} | |
- run: npm run test | |
- uses: codecov/codecov-action@v3 | |
with: | |
token: ${{ secrets.CODECOV_TOKEN }} | |
integration-test: | |
runs-on: ubuntu-latest | |
needs: dependencies-cache | |
strategy: | |
fail-fast: false | |
matrix: | |
node-version: [16, 18, 20] | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: ${{ matrix.node-version }} | |
- name: Restore node_modules cache | |
id: restore-cache-node-modules-node | |
uses: actions/cache/restore@v3 | |
with: | |
path: '**/node_modules' | |
key: ${{ runner.os }}-node-modules-${{ matrix.node-version }}-${{ hashFiles('package-lock.json') }} | |
- run: LEAGUE_ID=${{ secrets.LEAGUE_ID }} ESPN_S2=${{ secrets.ESPN_S2 }} SWID=${{ secrets.SWID }} npm run test:integration | |
build: | |
runs-on: ubuntu-latest | |
needs: dependencies-cache | |
strategy: | |
fail-fast: false | |
matrix: | |
node-version: [16, 18, 20] | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: ${{ matrix.node-version }} | |
- name: Restore node_modules cache | |
id: restore-cache-node-modules-node | |
uses: actions/cache/restore@v3 | |
with: | |
path: '**/node_modules' | |
key: ${{ runner.os }}-node-modules-${{ matrix.node-version }}-${{ hashFiles('package-lock.json') }} | |
- run: npm run build | |
docs: | |
runs-on: ubuntu-latest | |
needs: dependencies-cache | |
strategy: | |
fail-fast: false | |
matrix: | |
node-version: [16, 18, 20] | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: ${{ matrix.node-version }} | |
- name: Restore node_modules cache | |
id: restore-cache-node-modules-node | |
uses: actions/cache/restore@v3 | |
with: | |
path: '**/node_modules' | |
key: ${{ runner.os }}-node-modules-${{ matrix.node-version }}-${{ hashFiles('package-lock.json') }} | |
- run: npm run build:docs |