From a038c8fb26419b35e2524564f7852c899ddd2251 Mon Sep 17 00:00:00 2001 From: Nick Schonning Date: Sun, 9 Jan 2022 19:12:27 -0500 Subject: ci: setup GitHub Actions (#1782) --- .github/workflows/ci.yml | 74 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 74 insertions(+) create mode 100644 .github/workflows/ci.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..c8df5eb --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,74 @@ +name: CI + +on: + push: + pull_request: + +jobs: + lint: + runs-on: ubuntu-latest + steps: + - name: โฌ‡๏ธ Checkout + uses: actions/checkout@v2 + + - name: โŽ” Setup node ${{ matrix.node }} + uses: actions/setup-node@v2 + with: + cache: npm + + - name: ๐Ÿ“ฅ Download deps + run: npm ci + + - name: ๐Ÿงช Run lint + run: npm run lint + + build: + runs-on: ${{ matrix.os }} + needs: lint + strategy: + fail-fast: false + matrix: + node: + - 12 + - 14 + - 16 + - 17 + os: [ubuntu-latest, macos-latest, windows-latest] + browser: + - FirefoxHeadless + + steps: + - name: ๐Ÿ›‘ Cancel Previous Runs + uses: styfle/cancel-workflow-action@0.9.1 + with: + access_token: ${{ secrets.GITHUB_TOKEN }} + + - name: โฌ‡๏ธ Checkout + uses: actions/checkout@v2 + + - name: โŽ” Setup node ${{ matrix.node }} + uses: actions/setup-node@v2 + with: + node-version: ${{ matrix.node }} + cache: npm + + - name: ๐Ÿ“ฅ Download deps + run: npm ci + + - name: Run coverage + run: npm test + + - name: Run browser tests + run: npm run mocha-browser-test -- --browsers ${{ matrix.browser }} --timeout 10000 + env: + DISPLAY: :99.0 + + - name: Coverage + if: matrix.os == 'ubuntu-latest' && matrix.node == '14' + run: npm run coverage && npx nyc report --reporter=lcov + + - name: Coveralls + if: matrix.os == 'ubuntu-latest' && matrix.node == '14' + uses: coverallsapp/github-action@1.1.3 + with: + github-token: ${{ secrets.GITHUB_TOKEN }} -- cgit v1.2.1