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

Fix "Http Error" when running test reporter action on forked repo #181

Merged
merged 1 commit into from
May 28, 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
20 changes: 8 additions & 12 deletions .github/workflows/_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,6 @@ name: Test CI

on:
workflow_call:
inputs:
with-repoter:
required: false
type: boolean
default: true

permissions:
checks: write
Expand All @@ -19,11 +14,12 @@ jobs:
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/setup_flutter
- run: flutter test --machine > test_report.log
- name: Report
uses: dorny/test-reporter@v1
if: ${{ inputs.with-repoter }}
- run: |
set -o pipefail
flutter test --machine | tee test_report.log
set +o pipefail
- uses: actions/upload-artifact@v4
if: success() || failure()
with:
name: "flutter test"
path: "test_report.log"
reporter: "flutter-json"
name: flutter-unitTest-output
path: test_report.log
21 changes: 21 additions & 0 deletions .github/workflows/_test_report.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# see: https://github.com/dorny/test-reporter#recommended-setup-for-public-repositories
name: "Test CI Report"

on:
workflow_call:

permissions:
contents: read
actions: read
checks: write

jobs:
report:
runs-on: ubuntu-latest
steps:
- uses: dorny/test-reporter@v1
with:
artifact: flutter-unitTest-output
name: "flutter test"
path: "test_report.log"
reporter: "flutter-json"
13 changes: 9 additions & 4 deletions .github/workflows/app-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,18 +14,23 @@ jobs:
uses: ./.github/workflows/_analyze.yml

testing:
uses: ./.github/workflows/_test.yml

testing-report:
permissions:
contents: read
actions: read
checks: write
pull-requests: write
uses: ./.github/workflows/_test.yml
with:
with-repoter: false
needs:
- testing
uses: ./.github/workflows/_test_report.yml

pre-build:
name: Pre Building
needs:
- analyzing
- testing
- testing-report
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
Expand Down
17 changes: 17 additions & 0 deletions .github/workflows/mr-check-post.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: Post Merge request checking

on:
workflow_run:
workflows:
- Merge request checking
types:
- completed

permissions:
contents: read
actions: read
checks: write

jobs:
report:
uses: ./.github/workflows/_test_report.yml