-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
8bf94b7
commit 20d9f2b
Showing
2 changed files
with
92 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
name: Setup Node, Env and login to GHCR | ||
|
||
inputs: | ||
ghcr-username: | ||
required: false | ||
default: '' | ||
ghcr-password: | ||
required: false | ||
default: '' | ||
|
||
outputs: | ||
CI_SHA: | ||
description: "Short SHA of current commit" | ||
value: ${{ steps.ci-env.outputs.CI_SHA }} | ||
CI_BRANCH: | ||
description: "Current branch" | ||
value: ${{ steps.ci-env.outputs.CI_BRANCH }} | ||
|
||
runs: | ||
using: "composite" | ||
steps: | ||
- name: Login to GHCR (GitHub Packages) | ||
if: inputs.ghcr-username != '' && inputs.ghcr-password != '' | ||
uses: docker/login-action@v3 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ inputs.ghcr-username }} | ||
password: ${{ inputs.ghcr-password }} | ||
- id: ci-env | ||
name: Setup Environment | ||
shell: bash | ||
run: | | ||
if [ "${{github.event_name}}" = "pull_request" ]; | ||
then | ||
long_sha=${{ github.event.pull_request.head.sha }} | ||
echo "CI_BRANCH=${{ github.head_ref }}" >> $GITHUB_OUTPUT | ||
else | ||
long_sha=${GITHUB_SHA} | ||
echo "CI_BRANCH=${{ github.ref_name }}" >> $GITHUB_OUTPUT | ||
fi | ||
echo "CI_SHA=${long_sha:0:7}" >> $GITHUB_OUTPUT | ||
- uses: actions/setup-node@v4 | ||
with: | ||
node-version: 20 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,35 +1,65 @@ | ||
name: test | ||
on: [push] | ||
jobs: | ||
test: | ||
unit-tests: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions/setup-node@v1 | ||
- uses: actions/checkout@v4 | ||
- name: Setup Node | ||
uses: ./.github/actions/setup-and-login | ||
|
||
- name: Test back end | ||
run: npm test --prefix=app/server | ||
- name: Test front end | ||
run: npm run coverage --prefix=app/static | ||
- name: Check versions | ||
run: npm run genversion --prefix=app/server -- --check-only | ||
- uses: codecov/codecov-action@v4 | ||
with: | ||
node-version: 20.x | ||
- name: Install dependencies | ||
run: npm install -g typescript | ||
fail_ci_if_error: true # optional (default = false) | ||
files: ./app/server/coverage/coverage-final.json,./app/static/coverage/coverage-final.json | ||
token: ${{ secrets.CODECOV_TOKEN }} # required | ||
|
||
integration-tests: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Setup Node | ||
uses: ./.github/actions/setup-and-login | ||
|
||
- 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 | ||
run: npm test --prefix=app/server | ||
- name: Test back end integration | ||
run: npm run integration-test --prefix=app/server | ||
- name: Test front end | ||
run: npm run coverage --prefix=app/static | ||
|
||
playwright-tests: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Setup Node | ||
uses: ./.github/actions/setup-and-login | ||
|
||
- 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 | ||
|
||
lint: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Setup Node | ||
uses: ./.github/actions/setup-and-login | ||
|
||
- name: Lint back end | ||
run: npm run lint --prefix=app/server | ||
- name: Lint front end | ||
run: npm run lint --prefix=app/static | ||
- name: Check versions | ||
run: npm run genversion --prefix=app/server -- --check-only | ||
- uses: codecov/codecov-action@v4 | ||
with: | ||
fail_ci_if_error: true # optional (default = false) | ||
files: ./app/server/coverage/coverage-final.json,./app/static/coverage/coverage-final.json | ||
token: ${{ secrets.CODECOV_TOKEN }} # required |