Skip to content

Commit f8afb5b

Browse files
authored
Improve GitHub Actions (#375)
* Split GitHub Actions workflows to multiple files * Install yarn upon restoring the cache * Improve workflows * Simplify workflows * Artifacts - keep the .dmg
1 parent 04946f4 commit f8afb5b

File tree

2 files changed

+34
-38
lines changed

2 files changed

+34
-38
lines changed

.github/workflows/main.yml renamed to .github/workflows/build-app.yml

Lines changed: 4 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
name: CI
1+
name: Build App
22

33
on: [push, pull_request]
44

55
jobs:
6-
setup:
7-
runs-on: ubuntu-18.04
6+
build-macos:
7+
runs-on: macos-10.15
88

99
steps:
1010
- uses: actions/checkout@v2
@@ -23,40 +23,6 @@ jobs:
2323
- name: Install Dependencies
2424
run: yarn install
2525

26-
run-unit-tests:
27-
runs-on: ubuntu-18.04
28-
needs: setup
29-
30-
steps:
31-
- uses: actions/checkout@v2
32-
33-
- name: Get yarn cache
34-
id: yarn-cache
35-
run: echo "::set-output name=dir::$(yarn cache dir)"
36-
37-
- name: Install Dependencies
38-
run: yarn install
39-
40-
- name: Run Prettier (Check)
41-
run: yarn prettier-check
42-
43-
- name: Run Jest
44-
run: yarn test --coverage --runInBand
45-
46-
build-macos:
47-
runs-on: macos-10.15
48-
needs: setup
49-
50-
steps:
51-
- uses: actions/checkout@v2
52-
53-
- name: Get yarn cache
54-
id: yarn-cache
55-
run: echo "::set-output name=dir::$(yarn cache dir)"
56-
57-
- name: Install Dependencies
58-
run: yarn install
59-
6026
- name: Build
6127
run: yarn build
6228

@@ -70,7 +36,7 @@ jobs:
7036
run: yarn make:macos
7137

7238
- name: Clean up builds
73-
run: rm -rfv dist/mac dist/Gitify-*.dmg*
39+
run: rm -rfv dist/mac
7440

7541
- uses: actions/upload-artifact@v1
7642
with:

.github/workflows/run-tests.yml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: Run Tests
2+
3+
on: [push, pull_request]
4+
5+
jobs:
6+
run-unit-tests:
7+
runs-on: ubuntu-18.04
8+
9+
steps:
10+
- uses: actions/checkout@v2
11+
12+
- name: Get yarn cache
13+
id: yarn-cache
14+
run: echo "::set-output name=dir::$(yarn cache dir)"
15+
16+
- uses: actions/cache@v1
17+
with:
18+
path: ${{ steps.yarn-cache.outputs.dir }}
19+
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
20+
restore-keys: |
21+
${{ runner.os }}-yarn-
22+
23+
- name: Install Dependencies
24+
run: yarn install
25+
26+
- name: Run Prettier (Check)
27+
run: yarn prettier-check
28+
29+
- name: Run Jest
30+
run: yarn test --coverage --runInBand

0 commit comments

Comments
 (0)