-
Notifications
You must be signed in to change notification settings - Fork 2
156 lines (148 loc) · 4.54 KB
/
pr.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
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
name: Code Review
on:
pull_request:
types: [opened, synchronize]
branches-ignore:
- main
concurrency:
group: ${{ github.head_ref }}-pr
cancel-in-progress: true
env:
NODE_VERSION: '18'
jobs:
init:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- id: cache
uses: actions/cache@v3
with:
path: ./node_modules
key: modules-${{ hashFiles('package-lock.json') }}
- uses: actions/setup-node@v3
with:
node-version: ${{ env.NODE_VERSION }}
- if: steps.cache.outputs.cache-hit != 'true'
run: npm ci
lint:
runs-on: ubuntu-latest
needs: [init]
permissions: write-all
steps:
- uses: actions/checkout@v4
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: ${{ env.NODE_VERSION }}
- uses: fossas/fossa-action@main
with:
api-key: ${{ secrets.FOSSA_API_KEY }}
- 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]
permissions: write-all
steps:
- uses: actions/checkout@v4
- 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: ${{ env.NODE_VERSION }}
- run: npm run ci:build
- env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: npx auto shipit -d
test:
runs-on: ubuntu-latest
needs: [init]
timeout-minutes: 3
steps:
- uses: actions/checkout@v4
- 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: ${{ env.NODE_VERSION }}
- if: ${{ github.actor != 'dependabot[bot]' }}
uses: paambaati/[email protected]
env:
CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
coverageLocations: coverage/lcov.info:lcov
coverageCommand: npm run ci:test
- if: ${{ github.actor == 'dependabot[bot]' }}
run: npm run ci:test
test-e2e:
runs-on: ubuntu-latest
needs: [init]
timeout-minutes: 3
permissions: write-all
env:
CHARTMUSEUM_BASE_URL: http://localhost:8080
services:
# Label used to access the service container
chartmuseum:
# Docker Hub image
image: ghcr.io/helm/chartmuseum:v0.16.0
# Set health checks to wait until redis has started
ports:
- 8080:8080
env:
DEBUG: 1
STORAGE: 'local'
STORAGE_LOCAL_ROOTDIR: '/tmp/charts'
PORT: 8080
steps:
- uses: actions/checkout@v4
- 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: ${{ env.NODE_VERSION }}
# e2e dependencies
- name: Setup Helm
uses: azure/setup-helm@v3
- name: Setup helm-docs
run: |
wget https://github.com/norwoodj/helm-docs/releases/download/v1.11.0/helm-docs_1.11.0_Linux_x86_64.deb
sudo dpkg -i helm-docs_1.11.0_Linux_x86_64.deb
rm helm-docs_1.11.0_Linux_x86_64.deb
- name: Setup Helm Push Plugin
run: helm plugin install https://github.com/chartmuseum/helm-push
- name: Add Chartmuseum repo
run: helm repo add local $CHARTMUSEUM_BASE_URL
- env:
HELM_PLUGIN_ENABLE_CANARY: true
HELM_PLUGIN_PUSH: true
HELM_PLUGIN_REPOSITORY: '@local'
HELM_PLUGIN_PUBLISH_REPOSITORY: local
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: npm run ci:test:e2e