Skip to content

Commit

Permalink
ci(Mergify): configuration update (#614)
Browse files Browse the repository at this point in the history
* ci(Mergify): configuration update

Signed-off-by: Bhargav Ponnapalli <imbhargav5@gmail.com>

* fix: update prs

* fix: concurrency

* fix: concurrency

* fix(mergify): typo fix
  • Loading branch information
imbhargav5 authored Nov 11, 2021
1 parent a5cea07 commit 379d592
Show file tree
Hide file tree
Showing 3 changed files with 47 additions and 13 deletions.
13 changes: 7 additions & 6 deletions .github/workflows/ci-release.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
name: CI and Semantic Release
concurrency:
group: release-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
on:
push:
branches:
Expand All @@ -15,9 +18,7 @@ on:
branches-ignore: ["all-contributors/**"]
jobs:
main:
strategy:
matrix:
node: [14, 15]
name: Build (production)
runs-on: ubuntu-latest
steps:
- name: "Check if user has write access"
Expand All @@ -32,7 +33,7 @@ jobs:
- name: ⎔ Setup node
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node }}
node-version: 16

- name: Get yarn cache directory path
id: yarn-cache-dir-path
Expand All @@ -53,6 +54,7 @@ jobs:
uses: codecov/codecov-action@v2

release:
name: Publish To NPM
env:
ALGOLIA_API_KEY: ${{ secrets.ALGOLIA_API_KEY }}
needs: main
Expand All @@ -63,11 +65,10 @@ jobs:
steps:
- name: ⬇️ Checkout repo
uses: actions/checkout@v2

- name: ⎔ Setup node
uses: actions/setup-node@v1
with:
node-version: 14
node-version: 16
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"
Expand Down
40 changes: 33 additions & 7 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
@@ -1,20 +1,21 @@
name: Pull Request

on: pull_request
concurrency:
group: pr-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
build:
runs-on: ubuntu-latest

name: Build (test)
steps:
- uses: actions/checkout@master
- name: Use Node.js 15.x
- uses: actions/checkout@v2
- name: Setup node
uses: actions/setup-node@v1
with:
version: 15.x
version: 16
- run: git config user.email "me@imbhargav5.com"
- run: git config user.name "Bhargav Ponnapalli"
- name: Install now
run: now --version || npm i -g now
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"
Expand All @@ -29,7 +30,32 @@ jobs:
if: steps.yarn-cache.outputs.cache-hit != 'true' # Over here!
run: yarn
- name: build
run: yarn build
run: yarn build
test:
timeout-minutes: 10
runs-on: ubuntu-latest
name: Test (yarn test)
needs: build
steps:
- uses: actions/checkout@v2
- name: Setup node
uses: actions/setup-node@v1
with:
version: 16
- run: git config user.email "me@imbhargav5.com"
- run: git config user.name "Bhargav Ponnapalli"
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"
- uses: actions/cache@v2
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
with:
path: |
node_modules
*/*/node_modules
key: ${{ runner.os }}-${{ hashFiles('**/yarn.lock') }}
- name: Install project dependencies
if: steps.yarn-cache.outputs.cache-hit != 'true' # Over here!
- name: test
run: yarn test --coverage
- name: Upload coverage to Codecov
Expand Down
7 changes: 7 additions & 0 deletions .mergify.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
queue_rules:
- name: default
# speculative_checks: 3
# batch_size: 2
conditions:
- check-success=Build (test)
- check-success=Test (yarn test)
pull_request_rules:
- name: update out-of-sync PR
conditions:
Expand Down

0 comments on commit 379d592

Please sign in to comment.