-
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.
TEST-1234 Update example.spec.ts (#16)
<!--- Provide a general summary of your changes in the Title above --> ## Description 💬 <!--- Describe your changes in detail --> ## Motivation and Context 🥅 <!--- Why is this change required? What problem does it solve? --> <!--- If it fixes an open issue, please link to the issue here. --> ## How has this been tested? 🧪 <!--- Please describe in detail how you tested your changes. --> <!--- Include details of your testing environment, tests ran to see how --> <!--- your change affects other areas of the code, etc. --> - [ ] Local build ⚒️ - [ ] Local tests 🧪 - [ ] (optional) Local run and endpoint tested in swagger 🚀 ## Screenshots (if appropriate) 💻 ## Types of changes 🌊 <!--- What types of changes does your code introduce? Put an `x` in all the boxes that apply: --> - [ ] Bug fix (non-breaking change which fixes an issue) - [ ] New feature (non-breaking change which adds functionality) - [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected) ## Checklist ☑️ <!--- Go over all the following points, and put an `x` in all the boxes that apply. --> <!--- If you're unsure about any of these, don't hesitate to ask. We're here to help! --> - [ ] The pull request title starts with the jira case number (when applicable), e.g. "TEST-1234 Add some feature" - [ ] The person responsible for following up on requested review changes has been assigned to the pull request - [ ] My code follows the code style of this project. - [ ] My change requires a change to the documentation. - [ ] I have updated the documentation accordingly. ## Highly optional checks, only use these if you have a reason to do so ✔️ - [ ] This PR changes the database so I have added the *create-diagram* label to assist reviewers with a db diagram - [ ] This PR changes platform or backend and I need others to be able to test against these changes before merging to dev, so I have added the *deploy-azure* label to deploy before merging the PR ## Checklist for the approver ✅ - [ ] I've checked the files view for spelling issues, code quality warnings and similar - [ ] I've waited until all checks have passed (green check/without error) - [ ] I've checked that only the intended files are changed
- Loading branch information
Showing
48 changed files
with
2,592 additions
and
183 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
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,149 @@ | ||
name: "Frontend build" | ||
description: "Frontend (node) build and linting" | ||
branding: | ||
icon: table | ||
color: black | ||
|
||
inputs: | ||
working_directory: | ||
required: true | ||
description: root folder of the node project, e.g. ./src/frontend/ | ||
package_manager: | ||
required: false | ||
description: npm|yarn | ||
default: "yarn" | ||
|
||
runs: | ||
using: "composite" | ||
steps: | ||
- uses: actions/setup-node@v4 | ||
name: Setup node (npm) | ||
if: inputs.working_directory == 'npm' | ||
with: | ||
node-version: ${{ env.NODE_VERSION }} | ||
cache: "npm" | ||
cache-dependency-path: "${{ inputs.working_directory }}/package-lock.json" | ||
|
||
- uses: actions/setup-node@v4 | ||
name: Setup node (yarn) | ||
if: inputs.working_directory == 'yarn' | ||
with: | ||
node-version: ${{ env.NODE_VERSION }} | ||
cache: "yarn" | ||
cache-dependency-path: "${{ inputs.working_directory }}/yarn.lock" | ||
|
||
- name: Install dependencies | ||
shell: bash | ||
working-directory: ${{ inputs.working_directory }} | ||
run: | | ||
echo "::group::Install dependencies" | ||
[[ "${{ inputs.package_manager }}" == "npm" ]] && npm ci || true | ||
[[ "${{ inputs.package_manager }}" == "yarn" ]] && yarn install --immutable --immutable-cache --check-cache || true | ||
echo "::endgroup::" | ||
- name: Build | ||
id: node-build | ||
shell: bash | ||
working-directory: ${{ inputs.working_directory }} | ||
run: | | ||
echo "::group::Build" | ||
[[ "${{ inputs.package_manager }}" == "npm" ]] && npm run build 1>build.out 2>&1 || (exit 0) | ||
[[ "${{ inputs.package_manager }}" == "yarn" ]] && yarn build 1>build.out 2>&1 || (exit 0) | ||
echo -e "\nBuild output:\n" | ||
cat build.out | ||
grep "): error " build.out > build.err || (exit 0) | ||
if [ ! -s build.err ] | ||
then | ||
echo "## ✅ Build successful" > build.md | ||
else | ||
# Reformat error output as github error annotations | ||
error_regex="(.+)\(([0-9]+),[0-9]+\): error (.+)" | ||
cat build.err | while read line | ||
do | ||
if [[ $line =~ $error_regex ]]; then | ||
echo "::error file=${BASH_REMATCH[1]},line=${BASH_REMATCH[2]}::${BASH_REMATCH[3]}" | ||
fi | ||
done | ||
cp build.err build.md | ||
sed -i '/^$/d' build.md # removes empty lines | ||
sed -i -e 's/^/- ❌ /' build.md # prefix with markdown list item and cross mark emoji | ||
echo "## ❌ The following build issues should be fixed:" | cat - build.md > build.md.temp && mv build.md.temp build.md | ||
fi | ||
echo "result<<EOF"$'\n'"$(cat build.md)"$'\n'EOF >> $GITHUB_OUTPUT | ||
cat build.md >> $GITHUB_STEP_SUMMARY | ||
if [ -s build.err ] | ||
then | ||
exit 1 | ||
fi | ||
echo "::endgroup::" | ||
- name: Lint | ||
if: always() | ||
id: node-lint | ||
shell: bash | ||
working-directory: ${{ inputs.working_directory }} | ||
run: | | ||
echo "::group::Lint" | ||
[[ "${{ inputs.package_manager }}" == "npm" ]] && npm run lint -- -f compact 1>lint.out 2>&1 || (exit 0) | ||
[[ "${{ inputs.package_manager }}" == "yarn" ]] && yarn lint -f compact 1>lint.out 2>&1 || (exit 0) | ||
echo -e "\nLint output:\n" | ||
cat lint.out | ||
cat lint.out | grep ": line " | sed -e 's|${{ env.TRAILING_AGENT_WORK_PATH }}||' >lint.err || (exit 0) | ||
if [ ! -s lint.err ] | ||
then | ||
echo "## ✅ No linting issues 🎊" > lint.md | ||
else | ||
# Reformat lint output as github error annotations | ||
error_regex="(.+): line ([0-9]+), col [0-9]+, [A-Za-z]+ - (.+)" | ||
cat lint.err | while read line | ||
do | ||
if [[ $line =~ $error_regex ]]; then | ||
echo "::error file=${BASH_REMATCH[1]},line=${BASH_REMATCH[2]}::${BASH_REMATCH[3]}" | ||
fi | ||
done | ||
cp lint.err lint.md | ||
sed -i '/^$/d' lint.md # removes empty lines | ||
sed -i -e 's/^/- ❌ /' lint.md # prefix with markdown list item and cross mark emoji | ||
echo "## ❌ The following linting issues should be fixed:" | cat - lint.md > lint.md.temp && mv lint.md.temp lint.md | ||
fi | ||
echo "result<<EOF"$'\n'"$(cat lint.md)"$'\n'EOF >> $GITHUB_OUTPUT | ||
cat lint.md >> $GITHUB_STEP_SUMMARY | ||
if [ -s lint.err ] | ||
then | ||
exit 1 | ||
fi | ||
echo "::endgroup::" | ||
- name: Combine outputs to single PR comment | ||
if: always() | ||
id: pr-comment-combiner | ||
shell: bash | ||
working-directory: ${{ inputs.working_directory }} | ||
run: | | ||
echo "# ${{ env.WORKFLOW_SHORT_NAME }}" > combined.md | ||
cat build.md >> combined.md | ||
cat lint.md >> combined.md | ||
echo "result<<EOF"$'\n'"$(cat combined.md)"$'\n'EOF >> $GITHUB_OUTPUT | ||
- name: "Create or Update PR Comment" | ||
uses: im-open/[email protected] | ||
if: always() && github.event_name == 'pull_request' | ||
with: | ||
github-token: ${{ env.GH_TOKEN }} | ||
comment-identifier: "${{ env.WORKFLOW_SHORT_NAME }}-results" | ||
comment-content: ${{ steps.pr-comment-combiner.outputs.result }} | ||
|
||
- name: Create Todo Comments | ||
uses: gkampitakis/github-action-todo-commenter@v1 | ||
with: | ||
github-token: ${{ env.GH_TOKEN }} | ||
review-message: "Please take a look :eyes:" | ||
tags: "TODO:,FIXME:,BUG:" |
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
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
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 |
---|---|---|
|
@@ -26,6 +26,8 @@ permissions: | |
contents: read | ||
checks: write | ||
pull-requests: write | ||
actions: read # for super-linter | ||
statuses: write # for super-linter | ||
|
||
# This allows a subsequently queued workflow run to interrupt previous runs | ||
concurrency: | ||
|
@@ -35,6 +37,7 @@ concurrency: | |
env: | ||
DOTNET_VERSION: "8.0.x" | ||
BACKEND_SOLUTION_PATH: "src/backend" | ||
BACKEND_SOLUTION_FILE: "Backend.sln" | ||
WORKFLOW_SHORT_NAME: "backend-ci" | ||
WORKFLOW_AGENT_PATH: "/home/runner/work/test/test/" | ||
|
||
|
@@ -63,15 +66,15 @@ jobs: | |
key: nuget-${{ hashFiles('**/packages.lock.json') }} | ||
|
||
- name: dotnet restore | ||
run: dotnet restore --locked-mode | ||
run: dotnet restore --locked-mode ${{ env.BACKEND_SOLUTION_FILE }} | ||
|
||
- name: dotnet tool restore | ||
run: dotnet tool restore | ||
|
||
- name: Build | ||
id: dotnet-build | ||
run: | | ||
dotnet build -c Release --no-restore --nologo -consoleLoggerParameters:NoSummary -verbosity:quiet 1>build.out 2>&1 || (exit 0) | ||
dotnet build ${{ env.BACKEND_SOLUTION_FILE }} -c Release --no-restore --nologo -consoleLoggerParameters:NoSummary -verbosity:quiet 1>build.out 2>&1 || (exit 0) | ||
grep "): error " build.out > build.err || (exit 0) | ||
if [ ! -s build.err ] | ||
|
@@ -110,6 +113,27 @@ jobs: | |
comment-identifier: "${{ env.WORKFLOW_SHORT_NAME }}-build-results" | ||
comment-content: ${{ steps.dotnet-build.outputs.result }} | ||
|
||
- name: Create Todo Comments | ||
uses: gkampitakis/github-action-todo-commenter@v1 | ||
with: | ||
github-token: ${{ secrets.GITHUB_TOKEN }} | ||
review-message: "Please take a look :eyes:" | ||
tags: "TODO:,FIXME:,BUG:" | ||
|
||
# # TODO: move? | ||
# - name: Super-linter | ||
# uses: super-linter/[email protected] | ||
# env: | ||
# # To report GitHub Actions status checks | ||
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
# CREATE_LOG_FILE: true | ||
# LOG_FILE: super-linter.out | ||
# DISABLE_ERRORS: true | ||
|
||
# - run: | | ||
# ls -la ${{ env.WORKFLOW_AGENT_PATH }} | ||
# sudo cat ${{ env.WORKFLOW_AGENT_PATH }}super-linter.out >> $GITHUB_STEP_SUMMARY | ||
|
||
- name: WebApi Tests | ||
run: dotnet test ../../tests/backend/WebApi.Tests --no-restore --collect:"XPlat Code Coverage" --logger "trx;LogFileName=test-results.trx" /p:CollectCoverage=true /p:CoverletOutput="../../tests/backend/WebApi.Tests/TestResults/" /p:CoverletOutputFormat=cobertura | ||
|
||
|
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,53 @@ | ||
name: "Frontend CI" | ||
|
||
on: | ||
workflow_dispatch: | ||
push: | ||
branches: | ||
- dev | ||
tags: | ||
- "v*" | ||
paths: | ||
- "src/frontend/**" | ||
pull_request: | ||
branches: | ||
- main | ||
- test | ||
- dev | ||
paths: | ||
- "src/frontend/**" | ||
- ".github/workflows/frontend-ci.yml" | ||
types: [opened, reopened, labeled, synchronize, ready_for_review] | ||
|
||
# Sets permissions of the GITHUB_TOKEN to allow creating checks and updating PR | ||
permissions: | ||
contents: read | ||
checks: write | ||
pull-requests: write | ||
|
||
# This allows a subsequently queued workflow run to interrupt previous runs | ||
concurrency: | ||
group: "${{ github.workflow }} @ ${{ github.event.pull_request.head.label || github.head_ref || github.ref }}" | ||
cancel-in-progress: true | ||
|
||
env: | ||
NODE_VERSION: "20" | ||
WORKFLOW_SHORT_NAME: "frontend" | ||
FRONTEND_PATH: "src/frontend" | ||
TRAILING_AGENT_WORK_PATH: "/home/runner/work/test/test/" | ||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
if: ${{ github.event_name != 'pull_request' || github.event.pull_request.draft == false }} | ||
defaults: | ||
run: | ||
working-directory: ${{ env.FRONTEND_PATH }} | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- uses: ./.github/actions/frontend-build | ||
with: | ||
working_directory: ${{ env.FRONTEND_PATH }} |
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 |
---|---|---|
|
@@ -8,6 +8,9 @@ on: | |
- test | ||
pull_request: | ||
branches: | ||
- main | ||
- qa | ||
- test | ||
- dev | ||
- "feature/*" | ||
- "bugfix/*" | ||
|
Oops, something went wrong.