Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge test changes to main - v0.16.0-pre.8abc75d #11

Merged
merged 2 commits into from
Apr 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
58 changes: 55 additions & 3 deletions .github/workflows/backend-ci.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: "Backend CI - placeholder"
name: "Backend CI"

on:
workflow_dispatch:
Expand Down Expand Up @@ -35,6 +35,8 @@ concurrency:
env:
DOTNET_VERSION: "8.0.x"
BACKEND_SOLUTION_PATH: "src/backend"
WORKFLOW_SHORT_NAME: "backend-ci"
WORKFLOW_AGENT_PATH: "/home/runner/work/test/test/"

jobs:
build:
Expand Down Expand Up @@ -63,5 +65,55 @@ jobs:
- name: dotnet restore
run: dotnet restore --locked-mode

- name: dotnet build
run: dotnet build -c Release --no-restore
- name: Build
id: npm-build
run: |
dotnet build -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 ]
then
echo "## ✅ Build successful" > build.md
else
# Reformat error output as github error annotations
error_regex="(.+)\(([0-9]+),([0-9]+)\): error (.+) \[(.+)\]"
# Capture groups: 1=file path 2=line 3=character 4=warn: message 5=project path
cat build.err | while read line
do
if [[ $line =~ $error_regex ]]; then
echo "::error file=${BASH_REMATCH[1]},line=${BASH_REMATCH[2]}::${BASH_REMATCH[4]}"
fi
done

cat build.err | sed 's|${{ env.WORKFLOW_AGENT_PATH }}|| ; s|${{ env.WORKFLOW_AGENT_PATH }}||' > 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

- name: "Create or Update PR Comment"
uses: im-open/[email protected]
if: ${{ always() && github.event_name == 'pull_request' }}
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
comment-identifier: "${{ env.WORKFLOW_SHORT_NAME }}-build-results"
comment-content: ${{ steps.npm-build.outputs.result }}

- name: Inspect code
uses: muno92/resharper_inspectcode@v1
if: always()
with:
workingDirectory: ${{ env.BACKEND_SOLUTION_PATH }}
solutionPath: Backend.sln
dotnetVersion: ${{ env.DOTNET_VERSION }}
failOnIssue: false
include: |
**.cs
62 changes: 31 additions & 31 deletions .github/workflows/playwright.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,32 +60,32 @@ jobs:
- name: Build
id: npm-build
run: |
npm run build 1>npm-npm.out 2>&1 || (exit 0)
grep "): error " npm-npm.out > npm-npm.err || (exit 0)
npm run build 1>build.out 2>&1 || (exit 0)
grep "): error " build.out > build.err || (exit 0)

if [ ! -s npm-npm.err ]
if [ ! -s build.err ]
then
echo "## ✅ Build successful" > npm-npm.md
echo "## ✅ Build successful" > build.md
else
# Reformat error output as github error annotations
error_regex="(.+)\(([0-9]+),[0-9]+\): error (.+)"
cat npm-npm.err | while read line
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 npm-npm.err npm-npm.md
sed -i '/^$/d' npm-npm.md # removes empty lines
sed -i -e 's/^/- ❌ /' npm-npm.md # prefix with markdown list item and cross mark emoji
echo "## ❌ The following build issues should be fixed:" | cat - npm-npm.md > npm-npm.md.temp && mv npm-npm.md.temp npm-npm.md
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 npm-npm.md)"$'\n'EOF >> $GITHUB_OUTPUT
cat npm-npm.md >> $GITHUB_STEP_SUMMARY
echo "result<<EOF"$'\n'"$(cat build.md)"$'\n'EOF >> $GITHUB_OUTPUT
cat build.md >> $GITHUB_STEP_SUMMARY

if [ -s npm-npm.err ]
if [ -s build.err ]
then
exit 1
fi
Expand Down Expand Up @@ -203,25 +203,25 @@ jobs:
job-summary: true
icon-style: "emojis"

- name: Convert markdown to slack format
uses: denis-trofimov/[email protected]
if: ${{ (github.event_name == 'pull_request' || github.event_name == 'pull_request_target' || github.event_name == 'push') && always() }}
id: slackify-markdown
with:
text: ${{ steps.playwright-report-summary.outputs.summary }}

- name: Send custom JSON data to Slack workflow
if: ${{ (github.event_name == 'pull_request' || github.event_name == 'pull_request_target' || github.event_name == 'push') && always() }}
id: slack
uses: slackapi/[email protected]
with:
payload: |
{
"message": "${{ steps.slackify-markdown.outputs.text }}",
"deploy_target": "${{ inputs.deploy_target }}"
}
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
# - name: Convert markdown to slack format
# uses: denis-trofimov/[email protected]
# if: ${{ (github.event_name == 'pull_request' || github.event_name == 'pull_request_target' || github.event_name == 'push') && always() }}
# id: slackify-markdown
# with:
# text: ${{ steps.playwright-report-summary.outputs.summary }}

# - name: Send custom JSON data to Slack workflow
# if: ${{ (github.event_name == 'pull_request' || github.event_name == 'pull_request_target' || github.event_name == 'push') && always() }}
# id: slack
# uses: slackapi/[email protected]
# with:
# payload: |
# {
# "message": "${{ steps.slackify-markdown.outputs.text }}",
# "deploy_target": "${{ inputs.deploy_target }}"
# }
# env:
# SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}

- uses: actions/upload-artifact@v4
if: always()
Expand Down
12 changes: 12 additions & 0 deletions src/backend/.config/dotnet-tools.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"version": 1,
"isRoot": true,
"tools": {
"dotnet-ef": {
"version": "8.0.4",
"commands": [
"dotnet-ef"
]
}
}
}
Loading