diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..fc983b1 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,35 @@ +name: CI +on: [push] +jobs: + ci: + name: CI - Node ${{ matrix.node-version }}, ${{ matrix.os }} + + runs-on: ${{ matrix.os }} + strategy: + matrix: + # TODO: add back Node 18 once node-canvas is properly supported: https://github.com/Automattic/node-canvas/issues/2025 + node-version: [14.x, 16.x] # LTS Node: https://nodejs.org/en/about/releases/ + os: [ubuntu-latest, windows-latest, macOS-latest] + + steps: + - name: Checkout repo + uses: actions/checkout@v3 + - name: Setup Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v3 + with: + node-version: ${{ matrix.node-version }} + cache: 'npm' + - name: Install + run: npm ci + + - name: Typecheck + run: npm run tsc + - name: Lint + run: npm run lint + - name: Build + run: npm run build + + - name: Test w/ coverage report + run: npm run test:coverage + - name: Upload coverage report to Codecov + uses: codecov/codecov-action@v2 diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 6eb882a..0000000 --- a/.travis.yml +++ /dev/null @@ -1,12 +0,0 @@ -language: node_js -# default is the very old 0.10.48; use oldest LTS instead -node_js: 12 - -before_script: - - npm run lint - - npm run tsc -script: npm test -- --coverage -after_script: - # upload coverage reports to CodeCov - - bash <(curl -s https://codecov.io/bash) - - npm run test:pub