This repository was archived by the owner on Jun 16, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 295
122 lines (113 loc) · 3.52 KB
/
ci.yml
File metadata and controls
122 lines (113 loc) · 3.52 KB
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
name: CI
on:
pull_request_target:
branches:
- "*"
push:
branches:
- develop
- master
jobs:
type-checking:
runs-on: ubuntu-latest
steps:
- name: Cancel Previous Runs
uses: styfle/cancel-workflow-action@0.4.0
with:
access_token: ${{ secrets.GITHUB_TOKEN }}
- uses: actions/checkout@v2
with:
ref: ${{ github.event.pull_request.head.sha }}
repository: ${{github.event.pull_request.head.repo.full_name}}
- uses: actions/setup-node@main
with:
node-version: 12.x
- name: get yarn cache
id: yarn-cache
run: echo "::set-output name=dir::$(yarn cache dir)"
- uses: actions/cache@v2
with:
path: ${{ steps.yarn-cache.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: install dependencies
run: yarn --frozen-lockfile
- name: run code checks
run: yarn ci 2>lint.txt
- name: Read lint output
id: lint
if: always()
uses: juliangruber/read-file-action@v1
with:
path: ./lint.txt
- name: check build
run: sudo yarn build
- name: start electron webdriver
run: yarn start-electron-webdriver -d
- uses: nev7n/wait_for_response@v1
with:
url: 'http://localhost:9515/'
responseCode: 404
timeout: 600000
interval: 1000
- name: run spectron
run: yarn spectron --no-color 2>output.txt
- name: Read test output
id: spectron
if: always()
uses: juliangruber/read-file-action@v1
with:
path: ./output.txt
- name: upload diffs to imgur
if: always()
uses: ./.github/actions/upload-images
id: imgur
with:
path: tests/specs/__image_snapshots__/__diff_output__
- name: clean diff
if: always()
run: rm -f tests/specs/__image_snapshots__/__diff_output__/*.png
- name: upload ci suggested screenshots
uses: actions/upload-artifact@v2
if: always()
with:
name: ci-suggested-screenshots
path: tests/specs/__image_snapshots__/__diff_output__/
- name: prepare comment body
if: always()
id: comment
uses: ./.github/actions/prepare-comment-body
with:
images: ${{ steps.imgur.outputs.images }}
fullrepo: ${{ github.repository }}
runId: ${{ github.run_id }}
- name: post comment
if: (github.event_name == 'pull_request' || github.event_name == 'pull_request_target') && !cancelled()
uses: mshick/add-pr-comment@v1
with:
message: |
## Lint outputs
<details>
<summary>View</summary>
<p>
${{ steps.lint.outputs.content }}
</p>
</details>
## Tests outputs
<details>
<summary>View</summary>
<p>
${{ steps.spectron.outputs.content }}
</p>
</details>
## Diff output
<details>
<summary>View</summary>
<p>
${{ steps.comment.outputs.body }}
</p>
</details>
allow-repeats: true
repo-token: ${{ secrets.CI_BOT_TOKEN }}
repo-token-user-login: ${{ secrets.CI_BOT_USERNAME }}