From f0d12df7553dbb6bf3e456c105465b2204e0aa70 Mon Sep 17 00:00:00 2001 From: Oleksandr Hrishchuk Date: Wed, 28 Apr 2021 18:55:41 +0200 Subject: [PATCH 1/8] try parallel execution --- .github/workflows/main.yml | 58 +++++++++++++++++++++++--------------- 1 file changed, 35 insertions(+), 23 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 2d401ae7..bd2e3cbf 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -3,7 +3,7 @@ name: CI on: [push] jobs: - build: + install: runs-on: ubuntu-latest strategy: @@ -16,31 +16,43 @@ jobs: uses: actions/setup-node@v2 with: node-version: ${{ matrix.node-version }} - - name: install dependencies + - name: Install dependencies run: | yarn - - name: run lint - run: | - yarn lint - - name: run tests - run: | - yarn test --watchAll=false --coverage --reporters=default - - name: Upload coverage to Codecov - uses: codecov/codecov-action@v1.4.1 - with: - token: ${{ secrets.CODECOV_TOKEN }} - - name: build - run: | - yarn build + # - name: run lint + # run: | + # yarn lint + # - name: run tests + # run: | + # yarn test --watchAll=false --coverage --reporters=default + # - name: Upload coverage to Codecov + # uses: codecov/codecov-action@v1.4.1 + # with: + # token: ${{ secrets.CODECOV_TOKEN }} + # - name: build + # run: | + # yarn build - - name: semantic release - uses: cycjimmy/semantic-release-action@v2 - id: semantic - with: - branch: master - extra_plugins: | - @semantic-release/git@v9 - @semantic-release/changelog + # - name: semantic release + # uses: cycjimmy/semantic-release-action@v2 + # id: semantic + # with: + # branch: master + # extra_plugins: | + # @semantic-release/git@v9 + # @semantic-release/changelog env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} NPM_TOKEN: ${{ secrets.NPM_TOKEN }} + CI: true + lint: + runs-on: ubuntu-latest + needs: [install] + + steps: + - name: Running lint + uses: actions/checkout@v2 + - name: Lint + run: yarn lint + env: + CI: true From db5ba6207bfa24e223dbd68711a0b0f53a098b50 Mon Sep 17 00:00:00 2001 From: Oleksandr Hrishchuk Date: Wed, 28 Apr 2021 18:58:37 +0200 Subject: [PATCH 2/8] in parallel with tests --- .github/workflows/main.yml | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index bd2e3cbf..fb52c0e1 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -56,3 +56,15 @@ jobs: run: yarn lint env: CI: true + + test: + runs-on: ubuntu-latest + needs: [install] + + steps: + - name: Running tests + uses: actions/checkout@v2 + - name: Test + run: yarn test + env: + CI: true From d734753763bfc6e8efcfe7564fc2df2252d6f744 Mon Sep 17 00:00:00 2001 From: Oleksandr Hrishchuk Date: Wed, 28 Apr 2021 19:07:22 +0200 Subject: [PATCH 3/8] try with actions/cache@v2 --- .github/workflows/main.yml | 27 +++++++++++++++++++-------- 1 file changed, 19 insertions(+), 8 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index fb52c0e1..911900f6 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -2,23 +2,25 @@ name: CI on: [push] +env: + NODE_VERSION: 12.x + jobs: install: runs-on: ubuntu-latest - strategy: - matrix: - node-version: [10.x] - steps: - uses: actions/checkout@v2 - - name: Use Node.js ${{ matrix.node-version }} + - name: Use Node ${{ env.NODE_VERSION }} uses: actions/setup-node@v2 with: - node-version: ${{ matrix.node-version }} + node-version: ${{ env.NODE_VERSION }} + - uses: actions/cache@v2 + with: + path: '**/node_modules' + key: ${{ runner.os }}-${{ env.NODE_VERSION }}-modules-${{ hashFiles('**/yarn.lock') }} - name: Install dependencies - run: | - yarn + run: yarn install --frozen-lockfile # - name: run lint # run: | # yarn lint @@ -52,6 +54,10 @@ jobs: steps: - name: Running lint uses: actions/checkout@v2 + - uses: actions/cache@v2 + with: + path: '**/node_modules' + key: ${{ runner.os }}-${{ env.NODE_VERSION }}-modules-${{ hashFiles('**/yarn.lock') }} - name: Lint run: yarn lint env: @@ -64,6 +70,11 @@ jobs: steps: - name: Running tests uses: actions/checkout@v2 + - uses: actions/cache@v2 + with: + path: '**/node_modules' + key: ${{ runner.os }}-${{ env.NODE_VERSION }}-modules-${{ hashFiles('**/yarn.lock') }} + - name: Test - name: Test run: yarn test env: From 9c7f4a7ebeb92d4d71747973cdcc8afb738b99f1 Mon Sep 17 00:00:00 2001 From: Oleksandr Hrishchuk Date: Wed, 28 Apr 2021 19:10:28 +0200 Subject: [PATCH 4/8] Trigger CI --- .github/workflows/main.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 911900f6..ea89431f 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -3,13 +3,14 @@ name: CI on: [push] env: - NODE_VERSION: 12.x + NODE_VERSION: 10.x jobs: install: runs-on: ubuntu-latest steps: + - name: Trigger CI - uses: actions/checkout@v2 - name: Use Node ${{ env.NODE_VERSION }} uses: actions/setup-node@v2 From b2e3db9404ebfe67d72f4e8ebd75c2d981406343 Mon Sep 17 00:00:00 2001 From: Oleksandr Hrishchuk Date: Wed, 28 Apr 2021 19:13:32 +0200 Subject: [PATCH 5/8] another workflow --- .github/workflows/main.yml | 48 ++++++++++++++++---------------------- 1 file changed, 20 insertions(+), 28 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index ea89431f..5dbba15d 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -3,15 +3,15 @@ name: CI on: [push] env: - NODE_VERSION: 10.x + NODE_VERSION: 12.x jobs: install: runs-on: ubuntu-latest steps: - - name: Trigger CI - - uses: actions/checkout@v2 + - name: CI + uses: actions/checkout@v2 - name: Use Node ${{ env.NODE_VERSION }} uses: actions/setup-node@v2 with: @@ -22,32 +22,9 @@ jobs: key: ${{ runner.os }}-${{ env.NODE_VERSION }}-modules-${{ hashFiles('**/yarn.lock') }} - name: Install dependencies run: yarn install --frozen-lockfile - # - name: run lint - # run: | - # yarn lint - # - name: run tests - # run: | - # yarn test --watchAll=false --coverage --reporters=default - # - name: Upload coverage to Codecov - # uses: codecov/codecov-action@v1.4.1 - # with: - # token: ${{ secrets.CODECOV_TOKEN }} - # - name: build - # run: | - # yarn build - - # - name: semantic release - # uses: cycjimmy/semantic-release-action@v2 - # id: semantic - # with: - # branch: master - # extra_plugins: | - # @semantic-release/git@v9 - # @semantic-release/changelog env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - NPM_TOKEN: ${{ secrets.NPM_TOKEN }} CI: true + lint: runs-on: ubuntu-latest needs: [install] @@ -75,8 +52,23 @@ jobs: with: path: '**/node_modules' key: ${{ runner.os }}-${{ env.NODE_VERSION }}-modules-${{ hashFiles('**/yarn.lock') }} - - name: Test - name: Test run: yarn test env: CI: true + + build: + runs-on: ubuntu-latest + needs: [install] + + steps: + - name: Build + uses: actions/checkout@v2 + - uses: actions/cache@v2 + with: + path: '**/node_modules' + key: ${{ runner.os }}-${{ env.NODE_VERSION }}-modules-${{ hashFiles('**/yarn.lock') }} + - name: Build + run: yarn build + env: + CI: true From 5b45a64465b87f542aa581cb44c2d698c6d8b13d Mon Sep 17 00:00:00 2001 From: Oleksandr Hrishchuk Date: Wed, 28 Apr 2021 19:18:54 +0200 Subject: [PATCH 6/8] Upload coverage to Codecov --- .github/workflows/main.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 5dbba15d..27263268 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -53,7 +53,11 @@ jobs: path: '**/node_modules' key: ${{ runner.os }}-${{ env.NODE_VERSION }}-modules-${{ hashFiles('**/yarn.lock') }} - name: Test - run: yarn test + run: yarn test --coverage --reporters=default + - name: Upload coverage to Codecov + uses: codecov/codecov-action@v1.4.1 + with: + token: ${{ secrets.CODECOV_TOKEN }} env: CI: true From 68f2340e7781bd473190f5472840d7583ab2b679 Mon Sep 17 00:00:00 2001 From: Oleksandr Hrishchuk Date: Wed, 28 Apr 2021 19:27:44 +0200 Subject: [PATCH 7/8] release job --- .github/workflows/main.yml | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 27263268..6af35ca5 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -74,5 +74,15 @@ jobs: key: ${{ runner.os }}-${{ env.NODE_VERSION }}-modules-${{ hashFiles('**/yarn.lock') }} - name: Build run: yarn build + - name: Release + uses: cycjimmy/semantic-release-action@v2 + id: semantic + with: + branch: master + extra_plugins: | + @semantic-release/git@v9 + @semantic-release/changelog env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + NPM_TOKEN: ${{ secrets.NPM_TOKEN }} CI: true From b258bc955669b4d3a3012dbc90cf429fe85117c1 Mon Sep 17 00:00:00 2001 From: Oleksandr Hrishchuk Date: Wed, 28 Apr 2021 19:35:50 +0200 Subject: [PATCH 8/8] don't need ci option for the build --- .github/workflows/main.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 6af35ca5..18f30fd4 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -85,4 +85,3 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} NPM_TOKEN: ${{ secrets.NPM_TOKEN }} - CI: true