Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
101 changes: 43 additions & 58 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,64 +3,49 @@ name: build
# Controls when the action will run. Triggers the workflow on push or pull request
# events but only for the master branch
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
push:
branches: [master]
pull_request:
branches: [master]

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
build:
# The type of runner that the job will run on
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [10.x]

# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2

- 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: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-

- name: Setup node
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node }}

# Yarn is included in the list of software installed on the GitHub-hosted Ubuntu
# so there's no need to include a step install Yarn.

- name: Add prettier
run: yarn add prettier --dev

- name: Check code style
run: yarn run prettier --config ./.prettierrc.yaml --check ./src/*

- name: Install project dependencies
if: steps.yarn-cache.outputs.cache-hit != 'true'
run: yarn

- name: Build project
run: yarn build

- name: Test and generate coverage report
run: yarn test --watchAll=false --coverage

- name: Upload coverage to Codecov
uses: codecov/codecov-action@v1
with:
name: codecov-umbrella
fail_ci_if_error: false
# This workflow contains a single job called "build"
build:
# The type of runner that the job will run on
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [16.x]

# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v4

- name: Setup node
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: "yarn"

# Yarn is included in the list of software installed on the GitHub-hosted Ubuntu
# so there's no need to include a step install Yarn.

- name: Install dependencies
run: yarn

- name: Check code style
run: yarn run prettier --config ./.prettierrc.yaml --check ./src/*

- name: Build project
run: yarn build

- name: Test and generate coverage report
run: yarn test --watchAll=false --coverage

- name: Upload coverage to Codecov
uses: codecov/codecov-action@v4
with:
name: codecov-umbrella
fail_ci_if_error: false