j3lte/pastebin-ts

View on GitHub
.github/workflows/ci.yml

Summary

Maintainability
Test Coverage
name: master
on:
    push:
        branches:
            - master
            - main
    pull_request:
        paths-ignore:
            - '*.md'
jobs:
    buildtest:
        name: Node.js
        runs-on: ${{ matrix.os }}
        strategy:
            fail-fast: false
            matrix:
                node-version: [^14, ^16, ^18]
                os: [ubuntu-latest]
        steps:
            - uses: actions/checkout@v3
            - uses: actions/setup-node@v3
              with:
                  node-version: ${{ matrix.node-version }}
                  cache: 'yarn'
            - run: yarn install --frozen-lockfile
            - run: yarn test
            - uses: codecov/codecov-action@v3
              with:
                  token: ${{ secrets.CODECOV_TOKEN }}
                  files: coverage/lcov.info
                  name: ${{ matrix.os }}/${{ matrix.node-version }}
    deploy-docs:
        name: Deploy docs
        needs: buildtest
        runs-on: ubuntu-latest
        steps:
            - uses: actions/checkout@v3
            - uses: actions/setup-node@v3
              with:
                  node-version: '^18'
                  cache: 'yarn'
            - run: yarn install --frozen-lockfile
            - run: npx typedoc --out docs src/index.ts
            - name: Deploy
              uses: peaceiris/actions-gh-pages@v3
              with:
                  github_token: ${{ secrets.GITHUB_TOKEN }}
                  publish_dir: ./docs