Skip to content

포스팅 추가

포스팅 추가 #60

Workflow file for this run

name: build test before PR to main
permissions:
pull-requests: write
on:
pull_request:
branches: ["main"]
jobs:
build-and-test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: 1.23.4
- name: setup postgres test db
run: |
chmod +x ./script/test-db.sh
./script/test-db.sh
- name: Build file
run: go build ./cmd/main.go
- name: install go-ctrf-json-reporter
run: go install github.com/ctrf-io/go-ctrf-json-reporter/cmd/go-ctrf-json-reporter@latest
- name: Test with the Go CLI
run: go test ./... -json > test-report.json
- name: create ctrf-report.json
run: cat test-report.json | go-ctrf-json-reporter -output ctrf-report.json
if: always()
- name: Upload test report
uses: actions/upload-artifact@v4
if: always()
with:
name: ctrf-report
path: ctrf-report.json
report:
runs-on: ubuntu-latest
needs: build-and-test
if: always()
steps:
- name: Download test report
uses: actions/download-artifact@v4
with:
name: ctrf-report
- name: Setup Node.js
uses: actions/setup-node@v4
- name: Publish CTRF pull request comment
run: npx github-actions-ctrf pull-request ctrf-report.json
if: always()
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: annotate test result
run: npx github-actions-ctrf annotate ctrf-report.json