Skip to content

Commit

Permalink
adding more into the action
Browse files Browse the repository at this point in the history
  • Loading branch information
M-Kusumgar committed Nov 7, 2024
1 parent 20d9f2b commit 13ab650
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 12 deletions.
21 changes: 21 additions & 0 deletions .github/actions/setup-and-login/action.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
name: Setup Node, Env and login to GHCR

inputs:
install-packages:
required: false
default: false
build-and-run-server:
required: false
default: false
ghcr-username:
required: false
default: ''
Expand Down Expand Up @@ -43,3 +49,18 @@ runs:
- uses: actions/setup-node@v4
with:
node-version: 20

- name: Install packages
if: inputs.install-packages == true
shell: bash
run: |
npm i --prefix=app/server
npm i --prefix=app/static
- name: Build and run server
if: inputs.build-and-run-server == true
shell: bash
run: |
./scripts/build.sh
./scripts/run-dependencies.sh
npm run serve --prefix=app/server &
20 changes: 8 additions & 12 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ jobs:
- uses: actions/checkout@v4
- name: Setup Node
uses: ./.github/actions/setup-and-login
with:
install-packages: true

- name: Test back end
run: npm test --prefix=app/server
Expand All @@ -26,13 +28,9 @@ jobs:
- uses: actions/checkout@v4
- name: Setup Node
uses: ./.github/actions/setup-and-login
with:
build-and-run-server: true

- name: Build
run: ./scripts/build.sh
- name: Run dependencies
run: ./scripts/run-dependencies.sh
- name: Run server
run: npm run serve --prefix=app/server &
- name: Test back end integration
run: npm run integration-test --prefix=app/server

Expand All @@ -42,13 +40,9 @@ jobs:
- uses: actions/checkout@v4
- name: Setup Node
uses: ./.github/actions/setup-and-login
with:
build-and-run-server: true

- name: Build
run: ./scripts/build.sh
- name: Run dependencies
run: ./scripts/run-dependencies.sh
- name: Run server
run: npm run serve --prefix=app/server &
- name: Test e2e
run: npm run test:e2e --prefix=app/static

Expand All @@ -58,6 +52,8 @@ jobs:
- uses: actions/checkout@v4
- name: Setup Node
uses: ./.github/actions/setup-and-login
with:
install-packages: true

- name: Lint back end
run: npm run lint --prefix=app/server
Expand Down

0 comments on commit 13ab650

Please sign in to comment.