Skip to content

Commit

Permalink
ci: build par application, qui joue les migrations si nécessaire
Browse files Browse the repository at this point in the history
  • Loading branch information
thom4parisot committed Oct 15, 2024
1 parent 9531c37 commit 04e9da2
Show file tree
Hide file tree
Showing 4 changed files with 76 additions and 24 deletions.
19 changes: 19 additions & 0 deletions .github/workflows/node-export.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: Node `export` application

on:
push:
branches:
- master
paths:
- 'export/**'
- '.github/workflows/node.yml'
pull_request:
paths:
- 'export/**'
- '.github/workflows/node.yml'

jobs:
build:
uses: EcrituresNumeriques/stylo/.github/workflows/node.yml@feat/migrate-db
with:
app-dir: export
19 changes: 19 additions & 0 deletions .github/workflows/node-front.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: Node `front` application

on:
push:
branches:
- master
paths:
- 'front/**'
- '.github/workflows/node.yml'
pull_request:
paths:
- 'front/**'
- '.github/workflows/node.yml'

jobs:
build:
uses: EcrituresNumeriques/stylo/.github/workflows/node.yml@feat/migrate-db
with:
app-dir: front
19 changes: 19 additions & 0 deletions .github/workflows/node-graphql.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: Node `graphql` application

on:
push:
branches:
- master
paths:
- 'graphql/**'
- '.github/workflows/node.yml'
pull_request:
paths:
- 'graphql/**'
- '.github/workflows/node.yml'

jobs:
build:
uses: EcrituresNumeriques/stylo/.github/workflows/node.yml@feat/migrate-db
with:
app-dir: graphql
43 changes: 19 additions & 24 deletions .github/workflows/node.yml
Original file line number Diff line number Diff line change
@@ -1,28 +1,15 @@
name: Node applications

on:
push:
branches:
- master
paths:
- 'graphql/**'
- 'front/**'
- 'export/**'
- '.github/workflows/node.yml'
pull_request:
paths:
- 'graphql/**'
- 'front/**'
- 'export/**'
- '.github/workflows/node.yml'
workflow_call:
inputs:
app-dir:
required: true
type: string

jobs:
build:
runs-on: ubuntu-latest
strategy:
fail-fast: true
matrix:
app: [front, graphql, export]

steps:
- uses: actions/checkout@v4
Expand All @@ -31,19 +18,27 @@ jobs:
node-version-file: .nvmrc
cache: npm

- name: Install and test
working-directory: ${{ matrix.app }}
run: npm clean-install-test --no-audit --no-fund
- name: Install
working-directory: ${{ inputs.app-dir }}
run: npm clean-install --no-audit --no-fund

- name: Prepare
working-directory: ${{ inputs.app-dir }}
run: npm run migration --if-present

- name: Test
working-directory: ${{ inputs.app-dir }}
run: npm test

- name: Coveralls
uses: coverallsapp/github-action@v2
with:
base-path: ${{ matrix.app }}
base-path: ${{ inputs.app-dir }}
parallel: true
flag-name: run-${{ join(matrix.*, ' - ') }}
flag-name: run-${{ inputs.app-dir }}

- name: Build (if necessary)
working-directory: ${{ matrix.app }}
working-directory: ${{ inputs.app-dir }}
run: npm run build --if-present

finish:
Expand Down

0 comments on commit 04e9da2

Please sign in to comment.