2025-01-06 14:00:11 -05:00
|
|
|
name: Check PR
|
2024-12-13 15:10:27 -05:00
|
|
|
|
|
|
|
on:
|
|
|
|
pull_request:
|
|
|
|
merge_group:
|
|
|
|
|
2025-01-06 12:24:48 -05:00
|
|
|
permissions:
|
|
|
|
contents: read # for TimonVS/pr-labeler-action to read config file
|
|
|
|
pull-requests: write # for TimonVS/pr-labeler-action to add labels in PR
|
|
|
|
|
2024-12-13 15:10:27 -05:00
|
|
|
jobs:
|
2025-01-06 12:24:48 -05:00
|
|
|
verify-pr:
|
2025-01-06 14:00:11 -05:00
|
|
|
name: Test Lints
|
2024-12-19 06:49:21 -05:00
|
|
|
if: github.event_name == 'pull_request'
|
|
|
|
permissions:
|
2024-12-24 11:46:10 -05:00
|
|
|
contents: read # for TimonVS/pr-labeler-action to read config file
|
2024-12-19 06:49:21 -05:00
|
|
|
pull-requests: write # for TimonVS/pr-labeler-action to add labels in PR
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
2024-12-24 11:44:15 -05:00
|
|
|
- uses: actions/checkout@v4
|
|
|
|
with:
|
|
|
|
fetch-depth: 0 # Required to fetch all history for merging
|
2025-01-06 12:06:10 -05:00
|
|
|
|
2024-12-19 06:49:21 -05:00
|
|
|
- uses: TimonVS/pr-labeler-action@v5
|
|
|
|
with:
|
|
|
|
repo-token: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
configuration-path: .github/pr-labeler.yml # optional, .github/pr-labeler.yml is the default value
|
2025-01-06 12:06:10 -05:00
|
|
|
- name: Trunk Check
|
|
|
|
uses: trunk-io/trunk-action@v1
|
2024-12-24 11:44:15 -05:00
|
|
|
|
2024-12-13 15:10:27 -05:00
|
|
|
test-builds:
|
2024-12-13 15:21:54 -05:00
|
|
|
if: github.event_name == 'pull_request'
|
2024-12-13 15:10:27 -05:00
|
|
|
runs-on: ubuntu-latest
|
2025-01-06 14:00:11 -05:00
|
|
|
name: Test Builds
|
2024-12-13 15:10:27 -05:00
|
|
|
steps:
|
|
|
|
- name: Checkout repository
|
|
|
|
uses: actions/checkout@v4
|
|
|
|
with:
|
|
|
|
repository: onsonr/sonr
|
|
|
|
fetch-depth: 0
|
|
|
|
fetch-tags: true
|
|
|
|
|
|
|
|
- uses: actions/setup-go@v5
|
|
|
|
with:
|
|
|
|
go-version: "1.23"
|
|
|
|
check-latest: true
|
|
|
|
- name: Run Sonrd Build
|
|
|
|
run: make build
|
|
|
|
|
|
|
|
test-unit:
|
2024-12-13 15:21:54 -05:00
|
|
|
if: github.event_name == 'pull_request'
|
2024-12-13 15:10:27 -05:00
|
|
|
runs-on: ubuntu-latest
|
2025-01-06 14:00:11 -05:00
|
|
|
name: Test Unit
|
2024-12-13 15:10:27 -05:00
|
|
|
steps:
|
|
|
|
- name: Checkout repository
|
|
|
|
uses: actions/checkout@v4
|
|
|
|
with:
|
|
|
|
repository: onsonr/sonr
|
|
|
|
fetch-depth: 0
|
|
|
|
fetch-tags: true
|
|
|
|
|
|
|
|
- uses: actions/setup-go@v5
|
|
|
|
with:
|
|
|
|
go-version: "1.23"
|
|
|
|
check-latest: true
|
|
|
|
- run: make test-unit
|
|
|
|
|
2024-12-19 06:49:21 -05:00
|
|
|
validate-release:
|
2025-01-06 12:24:48 -05:00
|
|
|
if: github.event_name == 'merge_group' || github.event_name == 'pull_request'
|
2024-12-13 15:10:27 -05:00
|
|
|
runs-on: ubuntu-latest
|
2025-01-06 14:00:11 -05:00
|
|
|
name: Test Version
|
2024-12-13 15:10:27 -05:00
|
|
|
steps:
|
|
|
|
- name: Checkout repository
|
|
|
|
uses: actions/checkout@v4
|
|
|
|
with:
|
|
|
|
repository: onsonr/sonr
|
|
|
|
fetch-depth: 0
|
|
|
|
fetch-tags: true
|
|
|
|
|
|
|
|
- uses: actions/setup-go@v5
|
|
|
|
with:
|
|
|
|
go-version: "1.23"
|
|
|
|
check-latest: true
|
|
|
|
|
2025-01-06 14:00:11 -05:00
|
|
|
- name: Install Python
|
|
|
|
uses: actions/setup-python@v5
|
2024-12-24 11:24:04 -05:00
|
|
|
with:
|
2025-01-06 14:00:11 -05:00
|
|
|
python-version: "3.x"
|
2024-12-24 11:24:04 -05:00
|
|
|
|
2025-01-06 14:00:11 -05:00
|
|
|
- name: Version Check
|
|
|
|
run: make validate-tag
|
2024-12-13 15:10:27 -05:00
|
|
|
env:
|
|
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
|
2025-01-06 14:00:11 -05:00
|
|
|
- name: Check GoReleaser Config
|
|
|
|
run: make release-check
|
2024-12-13 15:10:27 -05:00
|
|
|
env:
|
|
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|