diff options
author | Nick Schonning <nschonni@gmail.com> | 2022-01-09 19:12:27 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-01-09 16:12:27 -0800 |
commit | a038c8fb26419b35e2524564f7852c899ddd2251 (patch) | |
tree | 4d698532ddc9f079faa7d616f41a2c58dedb9d6b | |
parent | e74bd18406e6511ca3da9d67d971d9b50dd9d8e8 (diff) | |
download | async-a038c8fb26419b35e2524564f7852c899ddd2251.tar.gz |
ci: setup GitHub Actions (#1782)
-rw-r--r-- | .github/workflows/ci.yml | 74 |
1 files changed, 74 insertions, 0 deletions
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 }} |