Skip to content

Commit

Permalink
Merge pull request #39 from junjange/test4
Browse files Browse the repository at this point in the history
단위 테스트 CI 워크플로우 추가
  • Loading branch information
junjange authored Jul 11, 2024
2 parents ce41e55 + 07e1ea2 commit 543ceeb
Show file tree
Hide file tree
Showing 3 changed files with 67 additions and 3 deletions.
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)
}
}

0 comments on commit 543ceeb

Please sign in to comment.