From fbdcac1a5c94eb5f9b30cbe8bdd54fa2170ac944 Mon Sep 17 00:00:00 2001 From: Andrey Sorokin Date: Mon, 15 Jun 2020 00:01:23 +0300 Subject: [PATCH] workflows --- .github/workflows/jest.yml | 42 ++++++++++++++++++++++++++++++++++++++ .github/workflows/lint.yml | 38 ++++++++++++++++++++++++++++++++++ 2 files changed, 80 insertions(+) create mode 100644 .github/workflows/jest.yml create mode 100644 .github/workflows/lint.yml diff --git a/.github/workflows/jest.yml b/.github/workflows/jest.yml new file mode 100644 index 0000000..964fbad --- /dev/null +++ b/.github/workflows/jest.yml @@ -0,0 +1,42 @@ +name: Jest + +on: + push: + branches: + - master + pull_request: + branches: + - master + +jobs: + jest: + runs-on: ubuntu-latest + + strategy: + matrix: + node-version: [13.x] + + steps: + - uses: actions/checkout@v2 + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v1 + with: + node-version: ${{ matrix.node-version }} + - name: Get yarn cache directory path + id: yarn-cache-dir-path + run: echo "::set-output name=dir::$(yarn cache dir)" + - uses: actions/cache@v1 + id: yarn-cache + with: + path: ${{ steps.yarn-cache-dir-path.outputs.dir }} + key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} + restore-keys: | + ${{ runner.os }}-yarn- + - name: Install yarn dependencies + run: yarn --cache + - name: Build package + run: (yarn build) || true + - name: Install example project dependencies + run: yarn example:install + - name: Run example project tests + run: yarn example:test diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml new file mode 100644 index 0000000..0ec4054 --- /dev/null +++ b/.github/workflows/lint.yml @@ -0,0 +1,38 @@ +name: ESlint + +on: + push: + branches: + - master + pull_request: + branches: + - master + +jobs: + lint: + runs-on: ubuntu-latest + + strategy: + matrix: + node-version: [13.x] + + steps: + - uses: actions/checkout@v2 + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v1 + with: + node-version: ${{ matrix.node-version }} + - name: Get yarn cache directory path + id: yarn-cache-dir-path + run: echo "::set-output name=dir::$(yarn cache dir)" + - uses: actions/cache@v1 + id: yarn-cache + with: + path: ${{ steps.yarn-cache-dir-path.outputs.dir }} + key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} + restore-keys: | + ${{ runner.os }}-yarn- + - name: Install yarn dependencies + run: yarn --cache + - name: Eslint + run: yarn lint