Skip to content

Commit

Permalink
Fixing action
Browse files Browse the repository at this point in the history
  • Loading branch information
schoenenberg committed Aug 6, 2024
1 parent fdfd127 commit 07672f6
Showing 1 changed file with 55 additions and 5 deletions.
60 changes: 55 additions & 5 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ jobs:
echo "text<<EOF" >> $GITHUB_OUTPUT
cat cargo_fmt_output.txt >> $GITHUB_OUTPUT
echo "EOF" >> $GITHUB_OUTPUT
echo "EOF" >> $GITHUB_OUTPUT
- name: Run cargo clippy
id: clippy
Expand All @@ -45,7 +45,29 @@ jobs:
echo "text<<EOF" >> $GITHUB_OUTPUT
cat cargo_clippy_output.txt >> $GITHUB_OUTPUT
echo "EOF" >> $GITHUB_OUTPUT
echo "EOF" >> $GITHUB_OUTPUT
- name: Build
id: build
working-directory: ./clearing-house-app
continue-on-error: true
run: |
cargo build >> cargo_build_output.txt || true
echo "text<<EOF" >> $GITHUB_OUTPUT
cat cargo_build_output.txt >> $GITHUB_OUTPUT
echo "EOF" >> $GITHUB_OUTPUT
- name: Test
id: test
working-directory: ./clearing-house-app
continue-on-error: true
run: |
cargo test >> cargo_test_output.txt || true
echo "text<<EOF" >> $GITHUB_OUTPUT
cat cargo_test_output.txt >> $GITHUB_OUTPUT
echo "EOF" >> $GITHUB_OUTPUT
- name: Post results to PR
uses: actions/github-script@v7
Expand All @@ -68,12 +90,40 @@ jobs:
clippyOutput = "_No linter warnings_";
}
const body = `
## "cargo fmt --check" Result:
let buildOutput = `<details><summary>Build log:</summary>
\`\`\`
${{ steps.build.outputs.text }}
\`\`\`
</details>`.trim();
if (buildOutput.length <= 58) {
buildOutput = "_No build output_";
}
let testOutput = `<details><summary>Test log:</summary>
\`\`\`
${{ steps.test.outputs.text }}
\`\`\`
</details>`.trim();
if (testOutput.length <= 57) {
testOutput = "_No test output_";
}
const body = `# Clearinghouse App Build report
## Formatter report ("cargo fmt --check"):
${fmtOutput}
## "cargo clippy" Result:
## Linter report ("cargo clippy"):
${clippyOutput}
## Build log
${buildOutput}
## Test log
${testOutput}
`;
github.rest.issues.createComment({
Expand Down

0 comments on commit 07672f6

Please sign in to comment.