-
Notifications
You must be signed in to change notification settings - Fork 28
110 lines (104 loc) · 2.98 KB
/
pull_request.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
name: Code Review
on:
pull_request:
types: [opened, synchronize]
concurrency:
group: ${{ github.head_ref }}-pr
cancel-in-progress: true
jobs:
init:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- id: cache
uses: actions/cache@v3
with:
path: ./node_modules
key: modules-${{ hashFiles('package-lock.json') }}
- uses: actions/setup-node@v3
with:
node-version: '18'
- if: steps.cache.outputs.cache-hit != 'true'
run: npm ci
lint:
runs-on: ubuntu-latest
needs: [init]
steps:
- uses: actions/checkout@v3
with:
token: ${{ secrets.GH_TOKEN }}
- uses: actions/cache@v3
with:
path: ./node_modules
key: modules-${{ hashFiles('package-lock.json') }}
- uses: actions/setup-node@v3
with:
node-version: '18'
- uses: wearerequired/lint-action@v2
with:
eslint: true
eslint_extensions: ts
prettier: true
prettier_extensions: ts,json,js,yml
auto_fix: true
commit_message: 'chore(lint): Fix code style issues with ${linter}'
github_token: ${{ secrets.GITHUB_TOKEN }}
git_email: '[email protected]'
build:
runs-on: ubuntu-latest
needs: [init]
steps:
- uses: actions/checkout@v3
- name: Prepare repository
run: git fetch --unshallow --tags
- uses: actions/cache@v3
with:
path: ./node_modules
key: modules-${{ hashFiles('package-lock.json') }}
- uses: actions/setup-node@v3
with:
node-version: '18'
- run: npm run ci:build
- env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
IMAGE: 'bull-monitor:latest'
run: npx auto shipit -d
test:
runs-on: ubuntu-latest
needs: [init]
timeout-minutes: 3
services:
# Label used to access the service container
redis:
# Docker Hub image
image: redis
# Set health checks to wait until redis has started
options: >-
--health-cmd "redis-cli ping"
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 6001:6379
steps:
- uses: actions/checkout@v3
- uses: actions/cache@v3
with:
path: ./node_modules
key: modules-${{ hashFiles('package-lock.json') }}
- uses: actions/setup-node@v3
with:
node-version: '18'
- if: ${{ github.actor != 'dependabot[bot]' }}
uses: mattallty/jest-github-action@v1
with:
test-command: npm run test:ci
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- if: ${{ github.actor == 'dependabot[bot]' }}
run: npm run test:ci
- run: npm run test:e2e
- name: unit tests
uses: paambaati/[email protected]
env:
CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }}