Skip to content

Commit 0e8c35d

Browse files
committed
Setup CI - ESLint
1 parent ffb5ef9 commit 0e8c35d

File tree

2 files changed

+61
-0
lines changed

2 files changed

+61
-0
lines changed

.github/workflows/nodejs.yml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: Node CI
2+
3+
on:
4+
workflow_dispatch:
5+
push:
6+
branches:
7+
- master
8+
- develop
9+
pull_request:
10+
branches:
11+
- '**'
12+
13+
concurrency:
14+
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
15+
cancel-in-progress: true
16+
17+
jobs:
18+
prepare-npm-cache-ubuntu:
19+
uses: ./.github/workflows/prepare-cache.yml
20+
with:
21+
os: ubuntu-latest
22+
23+
lint:
24+
name: Lint
25+
runs-on: ubuntu-latest
26+
needs: prepare-npm-cache-ubuntu
27+
28+
steps:
29+
- uses: actions/checkout@v3
30+
- uses: actions/setup-node@v3
31+
with:
32+
node-version: lts/*
33+
cache: npm
34+
- name: install
35+
run: npm ci
36+
- name: run eslint
37+
run: npm run lint

.github/workflows/prepare-cache.yml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: Prepare CI cache
2+
3+
on:
4+
workflow_call:
5+
inputs:
6+
os:
7+
required: true
8+
type: string
9+
10+
jobs:
11+
prepare-npm-cache:
12+
name: Prepare npm cache for ${{ input.os }}
13+
runs-on: ${{ input.os }}
14+
15+
steps:
16+
- uses: actions/checkout@v3
17+
18+
- uses: actions/setup-node@v3
19+
with:
20+
node-version: lts/*
21+
cache: npm
22+
23+
- name: Validate cache
24+
run: npm ci

0 commit comments

Comments
 (0)