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

단위 테스트 CI 워크플로우 추가 #39

Merged
merged 5 commits into from
Jul 11, 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
19 changes: 16 additions & 3 deletions .github/workflows/android-pull-request-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@ name: Android Pull Request CI
on:
push:
branches: [ develop ]
paths:
- 'android/**'
pull_request:
branches: [ develop ]
paths:
Expand All @@ -15,9 +13,24 @@ defaults:
working-directory: ./android

jobs:
unit_test:
verify:
runs-on: ubuntu-latest

permissions:
checks: write

# needed unless run with comment_mode: off
pull-requests: write

# only needed for private repository
contents: read

# only needed for private repository
issues: read

# required by download step to access artifacts API
actions: read

steps:
- name: Checkout the code
uses: actions/checkout@v3
Expand Down
46 changes: 46 additions & 0 deletions .github/workflows/publish_unit_test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: Publish Unit Test

on:
workflow_run:
workflows:
- "Android Pull Request CI"
types:
- completed

permissions: { }

jobs:
test-results:
name: Test Results
runs-on: ubuntu-latest
if: github.event.workflow_run.conclusion != 'skipped'

permissions:
checks: write

# needed unless run with comment_mode: off
pull-requests: write

# only needed for private repository
contents: read

# only needed for private repository
issues: read

# required by download step to access artifacts API
actions: read

steps:
- name: Download and Extract Artifacts
uses: dawidd6/action-download-artifact@246dbf436b23d7c49e21a7ab8204ca9ecd1fe615
with:
run_id: ${{ github.event.workflow_run.id }}
path: artifacts

- name: Publish Test Results
uses: EnricoMi/publish-unit-test-result-action@v2
with:
commit: ${{ github.event.workflow_run.head_sha }}
event_file: artifacts/Event File/event.json
event_name: ${{ github.event.workflow_run.event }}
files: "artifacts/**/*.xml"
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,9 @@ class ExampleUnitTest {
fun addition_isCorrect() {
assertEquals(4, 2 + 2)
}

@Test
fun addition_isCorrect2() {
assertEquals(4, 2 + 2)
}
}
Loading