Skip to content

Commit

Permalink
Fix uberjar build
Browse files Browse the repository at this point in the history
- Build the frontend first
- Runs the build as a separate job from tests
  • Loading branch information
jysandy committed Sep 3, 2020
1 parent e90285a commit e1d0b53
Showing 1 changed file with 34 additions and 12 deletions.
46 changes: 34 additions & 12 deletions .github/workflows/chronograph.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ env:
CHRONOGRAPH_JAR: chronograph.jar

jobs:
server-build:
server-test:
services:
postgres:
image: postgres:12.3
Expand Down Expand Up @@ -54,16 +54,7 @@ jobs:
- name: Run tests
run: lein test

- name: Build uberjar
run: lein uberjar

- name: Upload uberjar
uses: actions/upload-artifact@v2
with:
name: chronograph-uberjar
path: target/${{env.CHRONOGRAPH_JAR}}

frontend-build:
frontend-test:
runs-on: ubuntu-latest

steps:
Expand All @@ -75,10 +66,41 @@ jobs:
- name: Run frontend tests
run: yarn test

uberjar-build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2

- name: Cache lein deps
uses: actions/cache@v2
env:
cache-name: cache-lein-deps
with:
path: ~/.m2
key: ${{ env.cache-name }}-${{ hashFiles('**/project.clj') }}
restore-keys: |
${{ env.cache-name }}-
- name: Install frontend deps
run: yarn install

- name: Build the frontend
run: yarn release

- name: Build uberjar
run: lein uberjar

- name: Upload uberjar
uses: actions/upload-artifact@v2
with:
name: chronograph-uberjar
path: target/${{env.CHRONOGRAPH_JAR}}

staging-deploy:
runs-on: ubuntu-latest

needs: server-build
needs: uberjar-build

env:
CHRONOGRAPH_STAGING_INVENTORY: "staging.hosts"
Expand Down

0 comments on commit e1d0b53

Please sign in to comment.