-
-
Notifications
You must be signed in to change notification settings - Fork 0
69 lines (54 loc) · 1.84 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
name: CI
on: push
jobs:
prettify:
runs-on: ubuntu-latest
env:
SECRETS_AVAILABLE: ${{ secrets.CI_PERSONAL_TOKEN != '' }}
steps:
- uses: actions/checkout@v2
with:
token: ${{ secrets.CI_PERSONAL_TOKEN || github.token }}
- name: Import GPG key
uses: crazy-max/ghaction-import-gpg@v4
if: ${{ env.SECRETS_AVAILABLE == 'true' }}
with:
gpg_private_key: ${{ secrets.PRIVATE_KEY_CI }}
passphrase: ${{ secrets.PASSWORD_KEY_CI }}
git_user_signingkey: true
git_commit_gpgsign: true
- name: Setup Node.js
uses: actions/setup-node@v2
if: ${{ env.SECRETS_AVAILABLE == 'true' }}
with:
node-version: "14"
- name: Install prettier
if: ${{ env.SECRETS_AVAILABLE == 'true' }}
run: npm install --no-save "prettier@$(node -p -e "require('./package.json').devDependencies.prettier")"
- name: Run prettier
if: ${{ env.SECRETS_AVAILABLE == 'true' }}
run: npx prettier --write .
- name: Commit changes
if: ${{ env.SECRETS_AVAILABLE == 'true' }}
run: |
git config --global user.name 'robotcoralci'
git config --global user.email '[email protected]'
git add -A
if [ "$(git diff --name-only --cached)" ]; then git commit -S -m "chore: run Prettier"; fi
git push
run-angular-tests:
runs-on: ubuntu-latest
needs: [prettify]
steps:
- uses: actions/checkout@v2
- name: Use Node.js 14.x
uses: actions/setup-node@v1
with:
node-version: 14.x
- name: Setup
run: npm ci --no-optional --debug
- name: Build
run: npm run build
- name: Test
run: |
npm test -- --no-watch --no-progress --browsers=ChromeHeadlessCI