Skip to content

Commit

Permalink
ci: build and test in separate jobs
Browse files Browse the repository at this point in the history
  • Loading branch information
aminya committed Jun 2, 2021
1 parent 06c7337 commit 1a06e8a
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 13 deletions.
55 changes: 44 additions & 11 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,41 @@ on:
# - master

jobs:
Build:
if: "!contains(github.event.head_commit.message, '[skip ci]')"
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os:
- ubuntu-latest
atom_channel:
- stable
steps:
- uses: actions/checkout@v2
- uses: atom-community/action-setup-atom@v1
with:
channel: ${{ matrix.atom_channel }}

- name: Install dependencies and build
run: |
apm install
npm run clean
npm run tsc || echo done
npm run clean
npm run build
- name: Upload built files
uses: actions/upload-artifact@v2
with:
path: |
./dist
Test:
if: "!contains(github.event.head_commit.message, '[skip ci]')"
needs: Build
name: ${{ matrix.os }} - Atom ${{ matrix.atom_channel }}
runs-on: ${{ matrix.os }}
strategy:
Expand All @@ -24,11 +57,18 @@ jobs:
with:
channel: ${{ matrix.atom_channel }}

- name: Install dependencies and build
- name: Download articats
uses: actions/download-artifact@v2
- name: Place artifacts
shell: bash
run: |
apm install
npm run tsc || echo done
npm run build
rm -rf dist
mv artifact/* ./
- name: Install dependencies
run: |
apm install --production
npm install --only=dev # needed for testing
- name: Run tests 👩🏾‍💻
run: npm run test
Expand All @@ -55,10 +95,3 @@ jobs:

- name: Lint ✨
run: npm run test.lint

Skip:
if: contains(github.event.head_commit.message, '[skip ci]')
runs-on: ubuntu-latest
steps:
- name: Skip CI 🚫
run: echo skip ci
3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,7 @@
"build:services-docs": "markdox lib/services/index.js -o lib/services/README.md",
"build:plugin-docs": "markdox lib/plugin-api/hydrogen-provider.js lib/plugin-api/hydrogen-kernel.js -o docs/PluginAPI.md",
"build:docs": "npm run build:plugin-docs && npm run build:services-docs",
"build-commit": "npm run clean && build-commit -o dist",
"prepare": "npm run build"
"build-commit": "npm run clean && build-commit -o dist"
},
"atomTestRunner": "atom-jasmine3-test-runner",
"repository": "https://github.com/nteract/hydrogen",
Expand Down

0 comments on commit 1a06e8a

Please sign in to comment.