-
-
Notifications
You must be signed in to change notification settings - Fork 33
53 lines (45 loc) · 1.39 KB
/
ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
name: CI
# Run this workflow every time a new commit pushed to your repository
on:
push:
branches-ignore: [master]
pull_request:
branches: [master]
jobs:
# Set the job key. The key is displayed as the job name
# when a job name is not provided
format:
# Name the Job
name: Format
# Set the type of machine to run on
runs-on: ubuntu-latest
steps:
# Checks out a copy of your repository on the ubuntu-latest machine
- name: Checkout code
uses: actions/checkout@v2
with:
# Make sure the actual branch is checked out when running on pull requests
ref: ${{ github.head_ref }}
- name: Cache node modules
uses: actions/cache@v2
env:
cache-name: cache-node-modules
with:
path: ~/.npm
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-
- name: Install modules
run: npm ci
- name: Build
run: npm run build
- name: Prettify code
uses: creyD/[email protected]
with:
prettier_options: --write ./src/**/*.{js,svelte}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Run ESLint
run: npm run lint