Skip to content
This repository has been archived by the owner on Apr 5, 2024. It is now read-only.

Commit

Permalink
feat: add github action
Browse files Browse the repository at this point in the history
  • Loading branch information
maxgfr committed Feb 11, 2022
1 parent b9659cb commit 9acb4f0
Show file tree
Hide file tree
Showing 4 changed files with 92 additions and 24 deletions.
36 changes: 36 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Build

on: [pull_request, push]

concurrency:
cancel-in-progress: true
group: build-${{ github.ref }}

jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"
- name: Restore cache
uses: actions/cache@v2
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: Install dependencies
run: |
yarn install --prefer-offline --frozen-lockfile
- name: Build code
run: |
yarn build
- name: Cache build
uses: actions/cache@v2
with:
path: ./*
key: ${{ github.sha }}
20 changes: 20 additions & 0 deletions .github/workflows/e2e.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: Testing e2e

on: [pull_request, push]

concurrency:
cancel-in-progress: true
group: e2e-${{ github.ref }}

jobs:
e2e:
name: Testing e2e
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Cypress run
uses: cypress-io/github-action@v2
with:
build: yarn build
start: yarn start
29 changes: 5 additions & 24 deletions .github/workflows/quality.yml → .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
name: Code quality
name: Lint

on: [pull_request, push]

concurrency:
cancel-in-progress: true
group: quality-${{ github.ref }}
group: lint-${{ github.ref }}

jobs:
build:
name: Build
code:
name: Lint
runs-on: ubuntu-latest
steps:
- name: Checkout repository
Expand All @@ -26,26 +26,7 @@ jobs:
- name: Install dependencies
run: |
yarn install --prefer-offline --frozen-lockfile
- name: Build code
run: |
yarn build
- name: Cache build
uses: actions/cache@v2
with:
path: ./*
key: ${{ github.sha }}

lint:
name: Lint
runs-on: ubuntu-latest
needs: [build]
steps:
- uses: actions/cache@v2
name: Restore build
with:
path: ./*
key: ${{ github.sha }}
- name: Lint
- name: Lint
run: |
yarn lint
Expand Down
31 changes: 31 additions & 0 deletions .github/workflows/testing.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Testing

on: [pull_request, push]

concurrency:
cancel-in-progress: true
group: testing-${{ github.ref }}

jobs:
test:
name: Test
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"
- name: Restore cache
uses: actions/cache@v2
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: Install dependencies
run: |
yarn install --prefer-offline --frozen-lockfile
- name: Test code
run: |
yarn test

0 comments on commit 9acb4f0

Please sign in to comment.