Skip to content

Commit

Permalink
Add workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
0Tech committed Feb 23, 2024
1 parent eb175b7 commit 00cb5e1
Show file tree
Hide file tree
Showing 2 changed files with 51 additions and 0 deletions.
23 changes: 23 additions & 0 deletions .github/workflows/sonar.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Sonar
on:
workflow_run:
workflows:
- Tests
types:
- completed

jobs:
analysis:
runs-on: ubuntu-latest
if: github.event.workflow_run.conclusion == 'success'
steps:
- uses: actions/checkout@v3
with:
ref: github.event.workflow_run.referenced_workflows[0].ref
- uses: actions/download-artifact@v3
continue-on-error: true
with:
name: '${{ github.event.workflow_run.referenced_workflows[0].sha }}-app-coverage'
- name: dummy analysis
run: |
ls -la
28 changes: 28 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Tests
on:
pull_request:

jobs:
test-app:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v4
with:
go-version: '1.21'
- uses: technote-space/[email protected]
id: git_diff
with:
PATTERNS: |
**/*.go
go.mod
go.sum
- name: test app
if: env.GIT_DIFF
run: |
go test -coverprofile=cover.out ./...
- uses: actions/upload-artifact@v3
if: env.GIT_DIFF
with:
name: '${{ github.sha }}-app-coverage'
path: cover.out

0 comments on commit 00cb5e1

Please sign in to comment.