From ecdabc987955554986e2c0293e7ffbc83b5f08f5 Mon Sep 17 00:00:00 2001 From: Konstantin Vyatkin Date: Thu, 11 Jun 2020 00:01:56 -0400 Subject: [PATCH] add GitHub Actions --- .github/workflows/ci.yml | 56 ++++++++++++++++++++++++++++++++++++++ .github/workflows/lint.yml | 20 ++++++++++++++ 2 files changed, 76 insertions(+) create mode 100644 .github/workflows/ci.yml create mode 100644 .github/workflows/lint.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..c117b61 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,56 @@ +name: CI + +on: + push: + branches: [master] + pull_request: + paths: + - "**.js" + - "package.json" + - ".github/workflows/ci.yml" + +jobs: + test: + strategy: + matrix: + os: [ubuntu-latest, windows-latest, macOS-latest] + node: ["14", "12", engines] + exclude: + # On Windows, run tests with only the LTS environments. + - os: windows-latest + node: engines + - os: windows-latest + node: "14" + # On macOS, run tests with only the LTS environments. + - os: macOS-latest + node: engines + - os: macOS-latest + node: "14" + + runs-on: ${{ matrix.os }} + steps: + - uses: actions/checkout@v2 + + - name: Get Node.JS version from package.json + if: matrix.node == 'engines' + id: get-version + run: echo ::set-output name=node::$(npx --q minimum-node-version) + + - uses: actions/setup-node@v2-beta + if: matrix.node != 'engines' + with: + node-version: ${{ matrix.node }} + + - uses: actions/setup-node@v2-beta + if: matrix.node == 'engines' + with: + node-version: ${{steps.get-version.outputs.node}} + + - run: npm install + + - run: npm run report -- --colors + + - name: Upload coverage to Codecov + uses: codecov/codecov-action@v1 + with: + file: ./coverage/coverage-final.json diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml new file mode 100644 index 0000000..1ce559e --- /dev/null +++ b/.github/workflows/lint.yml @@ -0,0 +1,20 @@ +name: CI + +on: + pull_request: + paths: + - "**.js" + - "**eslint**" + - "package.json" + - ".github/workflows/lint.yml" +jobs: + lint: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Use Node.js + uses: actions/setup-node@v2-beta + with: + node-version: 14 + - run: npm install + - run: npm run lint