-
Notifications
You must be signed in to change notification settings - Fork 0
113 lines (108 loc) · 3.27 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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
name: CI
on:
push:
branches:
- develop
- main
pull_request:
branches:
- develop
- main
permissions: read-all
env:
NODE_ENV: development
SLACK_CHANNEL: ${{ secrets.SLACK_CHANNEL }}
SLACK_SIGNING_SECRET: ${{ secrets.SLACK_SIGNING_SECRET }}
SLACK_TOKEN: ${{ secrets.SLACK_TOKEN }}
jobs:
build:
runs-on: ubuntu-latest
timeout-minutes: 15
strategy:
matrix:
node_version: [14.x]
steps:
- name: Check out
uses: actions/checkout@v3
- name: Set up Node.js ${{ matrix.node_version }}
uses: actions/setup-node@v3
id: node
with:
node-version: ${{ matrix.node_version }}
- name: Send Slack notification
uses: codedsolar/slack-action@v1
if: ${{ github.event_name != 'pull_request' }}
id: slack
with:
status: in-progress
fields: |
{STATUS}
{REF}
Node.js: ${{ steps.node.outputs.node-version }}
- name: Install dependencies
run: yarn install --ignore-scripts
- name: Build
run: yarn build
env:
NODE_ENV: production
- name: Update Slack notification
uses: codedsolar/slack-action@v1
if: ${{ github.event_name != 'pull_request' && always() }}
with:
status: ${{ job.status }}
timestamp: ${{ steps.slack.outputs.slack-timestamp }}
fields: |
{STATUS}
{REF}
Node.js: ${{ steps.node.outputs.node-version }}
lint:
runs-on: ubuntu-latest
timeout-minutes: 15
strategy:
matrix:
node_version: [14.x]
steps:
- name: Check out
uses: actions/checkout@v3
- name: Set up Node.js ${{ matrix.node_version }}
uses: actions/setup-node@v3
id: node
with:
node-version: ${{ matrix.node_version }}
- name: Send Slack notification
uses: codedsolar/slack-action@v1
if: ${{ github.event_name != 'pull_request' }}
id: slack
with:
status: in-progress
fields: |
{STATUS}
{REF}
Node.js: ${{ steps.node.outputs.node-version }}
ESLint issues: Checking...
Prettier issues: Checking...
- name: Install dependencies
run: yarn install --ignore-scripts
- name: Lint
id: lint
run: |
yarn ci:eslint || true
yarn ci:prettier || true
yarn lint || true
- name: Lint results
id: lint-results
run: |
export LINT_ISSUES=$((${{ steps.lint.outputs.eslint-issues || 0 }} + ${{ steps.lint.outputs.prettier-issues || 0 }}))
if [ "${LINT_ISSUES}" -eq 0 ]; then exit 0; else exit 1; fi
- name: Update Slack notification
uses: codedsolar/slack-action@v1
if: ${{ github.event_name != 'pull_request' && always() }}
with:
status: ${{ job.status }}
timestamp: ${{ steps.slack.outputs.slack-timestamp }}
fields: |
{STATUS}
{REF}
Node.js: ${{ steps.node.outputs.node-version }}
ESLint issues: ${{ steps.lint.outputs.eslint-issues || 'Skipped' }}
Prettier issues: ${{ steps.lint.outputs.prettier-issues || 'Skipped' }}