Skip to content

Commit 1a06e8a

Browse files
committed
ci: build and test in separate jobs
1 parent 06c7337 commit 1a06e8a

File tree

2 files changed

+45
-13
lines changed

2 files changed

+45
-13
lines changed

.github/workflows/CI.yml

+44-11
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,41 @@ on:
66
# - master
77

88
jobs:
9+
Build:
10+
if: "!contains(github.event.head_commit.message, '[skip ci]')"
11+
runs-on: ${{ matrix.os }}
12+
strategy:
13+
fail-fast: false
14+
matrix:
15+
os:
16+
- ubuntu-latest
17+
atom_channel:
18+
- stable
19+
steps:
20+
- uses: actions/checkout@v2
21+
- uses: atom-community/action-setup-atom@v1
22+
with:
23+
channel: ${{ matrix.atom_channel }}
24+
25+
- name: Install dependencies and build
26+
run: |
27+
apm install
28+
29+
npm run clean
30+
npm run tsc || echo done
31+
32+
npm run clean
33+
npm run build
34+
35+
- name: Upload built files
36+
uses: actions/upload-artifact@v2
37+
with:
38+
path: |
39+
./dist
40+
941
Test:
1042
if: "!contains(github.event.head_commit.message, '[skip ci]')"
43+
needs: Build
1144
name: ${{ matrix.os }} - Atom ${{ matrix.atom_channel }}
1245
runs-on: ${{ matrix.os }}
1346
strategy:
@@ -24,11 +57,18 @@ jobs:
2457
with:
2558
channel: ${{ matrix.atom_channel }}
2659

27-
- name: Install dependencies and build
60+
- name: Download articats
61+
uses: actions/download-artifact@v2
62+
- name: Place artifacts
63+
shell: bash
2864
run: |
29-
apm install
30-
npm run tsc || echo done
31-
npm run build
65+
rm -rf dist
66+
mv artifact/* ./
67+
68+
- name: Install dependencies
69+
run: |
70+
apm install --production
71+
npm install --only=dev # needed for testing
3272
3373
- name: Run tests 👩🏾‍💻
3474
run: npm run test
@@ -55,10 +95,3 @@ jobs:
5595

5696
- name: Lint ✨
5797
run: npm run test.lint
58-
59-
Skip:
60-
if: contains(github.event.head_commit.message, '[skip ci]')
61-
runs-on: ubuntu-latest
62-
steps:
63-
- name: Skip CI 🚫
64-
run: echo skip ci

package.json

+1-2
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,7 @@
4848
"build:services-docs": "markdox lib/services/index.js -o lib/services/README.md",
4949
"build:plugin-docs": "markdox lib/plugin-api/hydrogen-provider.js lib/plugin-api/hydrogen-kernel.js -o docs/PluginAPI.md",
5050
"build:docs": "npm run build:plugin-docs && npm run build:services-docs",
51-
"build-commit": "npm run clean && build-commit -o dist",
52-
"prepare": "npm run build"
51+
"build-commit": "npm run clean && build-commit -o dist"
5352
},
5453
"atomTestRunner": "atom-jasmine3-test-runner",
5554
"repository": "https://github.com/nteract/hydrogen",

0 commit comments

Comments
 (0)