Skip to content

Commit

Permalink
ATO-762: Updating tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
kalpaitch committed Jul 23, 2024
1 parent 0bd9869 commit b8c6ba5
Show file tree
Hide file tree
Showing 2 changed files with 51 additions and 10 deletions.
47 changes: 47 additions & 0 deletions .github/actions/build-backend-component/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: "Build application"
description: "Build and compile all the assets required to run the application in the container"
inputs:
component:
description: "The backend component to build"
required: true
artifact-name:
description: "The artifact name to store the build cache under"
required: true
default: backend-build
outputs:
artifact-id:
description: "The artifact id for the artifact that was just uploaded or empty if the artifact upload failed."
value: ${{ steps.upload.outputs.artifact-id }}
runs:
using: composite
steps:
- name: Pull repository
id: checkout
uses: actions/checkout@v4

- name: Install Node
id: node
uses: actions/setup-node@v4
with:
cache: npm
node-version: 18

- name: Install Node dependencies
id: install
shell: bash
working-directory: backend/${{ inputs.component }}
run: npm install --include-workspace-root

- name: Archive distribution artifact
id: upload
uses: actions/upload-artifact@v4
with:
name: ${{ inputs.artifact-name }}-${{ inputs.component }}
retention-days: 7
path: |
express/dist
express/resources
express/src/views
express/assets/images
express/package*.json
express/manifest.yml
14 changes: 4 additions & 10 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,11 +70,8 @@ jobs:
id: checkout
uses: actions/checkout@v4

- name: Build
id: build
uses: ./.github/actions/build-frontend
with:
artifact-name: frontend-build-sonar
- name: Install Node dependencies
run: npm install

- name: Generate coverage report
run: npm run test:cov
Expand All @@ -97,11 +94,8 @@ jobs:
id: checkout
uses: actions/checkout@v4

- name: Build
id: build
uses: ./.github/actions/build-frontend
with:
artifact-name: frontend-build-tests
- name: Install Node dependencies
run: npm install

- name: Run unit tests
id: run-tests
Expand Down

0 comments on commit b8c6ba5

Please sign in to comment.