forked from dima117/unit-demo-cra
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: separate workflows, add eslint and prettier
- Loading branch information
Showing
6 changed files
with
159 additions
and
59 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
name: Commitlint | ||
|
||
on: [push, pull_request, workflow_call] | ||
|
||
jobs: | ||
commitlint: | ||
name: Commitlint | ||
runs-on: ubuntu-latest | ||
defaults: | ||
run: | ||
shell: bash | ||
working-directory: . | ||
steps: | ||
- uses: ${{ github.workspace }}/.github/workflows/setup.yml | ||
# - uses: actions/checkout@v3 | ||
# with: | ||
# fetch-depth: 0 | ||
# - name: Install system dependencies | ||
# run: | | ||
# sudo apt-get update | ||
# sudo apt-get upgrade | ||
# sudo apt-get install -y git | ||
# - name: Install Node.js | ||
# uses: actions/setup-node@v3 | ||
# with: | ||
# node-version-file: '.nvmrc' | ||
- name: Install commitlint | ||
run: | | ||
npm install conventional-changelog-conventionalcommits | ||
npm install commitlint@latest | ||
- name: Validate current commit (last commit) with commitlint | ||
if: github.event_name == 'push' # || github.event_name == 'workflow_call' | ||
run: npx commitlint --from HEAD~1 --to HEAD --verbose | ||
- name: Validate PR commits with commitlint | ||
if: github.event_name == 'pull_request' | ||
run: npx commitlint --from ${{ github.event.pull_request.head.sha }}~${{ github.event.pull_request.commits }} --to ${{ github.event.pull_request.head.sha }} --verbose |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
name: ESLint | ||
|
||
on: [push, pull_request, workflow_call] | ||
|
||
jobs: | ||
eslint: | ||
name: ESLint | ||
runs-on: ubuntu-latest | ||
defaults: | ||
run: | ||
shell: bash | ||
working-directory: . | ||
steps: | ||
- uses: ${{ github.workspace }}/.github/workflows/setup.yml | ||
# - uses: actions/checkout@v3 | ||
# with: | ||
# fetch-depth: 0 | ||
# - name: Install system dependencies | ||
# run: | | ||
# sudo apt-get update | ||
# sudo apt-get upgrade | ||
# sudo apt-get install -y git | ||
# - name: Install correct Node.js version | ||
# uses: actions/setup-node@v3 | ||
# with: | ||
# node-version-file: '.nvmrc' | ||
# cache: 'npm' | ||
# cache-dependency-path: 'package-lock.json' | ||
# - name: Install dependencies | ||
# run: npm ci | ||
- name: Run `lint:check` npm script | ||
run: npm run lint:check |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
name: Prettier | ||
|
||
on: [push, pull_request, workflow_call] | ||
|
||
jobs: | ||
eslint: | ||
name: Prettier | ||
runs-on: ubuntu-latest | ||
defaults: | ||
run: | ||
shell: bash | ||
working-directory: . | ||
steps: | ||
- uses: ${{ github.workspace }}/.github/workflows/setup.yml | ||
# - uses: actions/checkout@v3 | ||
# with: | ||
# fetch-depth: 0 | ||
# - name: Install system dependencies | ||
# run: | | ||
# sudo apt-get update | ||
# sudo apt-get upgrade | ||
# sudo apt-get install -y git | ||
# - name: Install correct Node.js version | ||
# uses: actions/setup-node@v3 | ||
# with: | ||
# node-version-file: '.nvmrc' | ||
# cache: 'npm' | ||
# cache-dependency-path: 'package-lock.json' | ||
# - name: Install dependencies | ||
# run: npm ci | ||
- name: Run `format:check` npm script | ||
run: npm run format:check |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
name: Set up workflow machine | ||
|
||
on: [workflow_call] | ||
|
||
jobs: | ||
setup: | ||
name: Setup | ||
runs-on: ubuntu-latest | ||
defaults: | ||
run: | ||
shell: bash | ||
working-directory: . | ||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
- name: Install system dependencies | ||
# sudo apt-get install -y git | ||
run: | | ||
sudo apt-get update | ||
sudo apt-get upgrade | ||
- name: Install correct Node.js version | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version-file: '.nvmrc' | ||
cache: 'npm' | ||
cache-dependency-path: 'package-lock.json' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
name: Unit tests | ||
|
||
on: [push, pull_request, workflow_call] | ||
|
||
jobs: | ||
unit-test: | ||
name: Unit tests | ||
runs-on: ubuntu-latest | ||
defaults: | ||
run: | ||
shell: bash | ||
working-directory: . | ||
steps: | ||
- uses: ${{ github.workspace }}/.github/workflows/setup.yml | ||
# - uses: actions/checkout@v3 | ||
# with: | ||
# fetch-depth: 0 | ||
# - name: Install system dependencies | ||
# run: | | ||
# sudo apt-get update | ||
# sudo apt-get upgrade | ||
# sudo apt-get install -y git | ||
# - name: Install correct Node.js version | ||
# uses: actions/setup-node@v3 | ||
# with: | ||
# node-version-file: '.nvmrc' | ||
# cache: 'npm' | ||
# cache-dependency-path: 'package-lock.json' | ||
# - name: Install dependencies | ||
# run: npm ci | ||
- name: Run `test-ci` npm script | ||
run: npm run test-ci |