Skip to content

Commit e4d51d0

Browse files
authored
Add build to CI step to ensure main always builds
1 parent 39426ca commit e4d51d0

2 files changed

Lines changed: 39 additions & 7 deletions

File tree

.github/workflows/pr-build.yml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: PR Build check
2+
3+
on:
4+
pull_request:
5+
# Re-run the version calculation when labels are added or when new commits are pushed
6+
types: [opened, synchronize, labeled, reopened, edited]
7+
branches: [main]
8+
9+
permissions:
10+
pull-requests: write
11+
contents: read
12+
13+
jobs:
14+
preview:
15+
runs-on: ubuntu-latest
16+
env:
17+
DOTNET_VERSION: 9.0
18+
PROJECT: StarMapLoader/StarMapLoader.csproj
19+
20+
steps:
21+
- uses: actions/checkout@v4
22+
with:
23+
fetch-depth: 0
24+
25+
- uses: actions/setup-dotnet@v4
26+
with:
27+
dotnet-version: ${{ env.DOTNET_VERSION }}
28+
29+
- name: Restore dependencies
30+
run: dotnet restore ${{ env.PROJECT }}
31+
32+
# - name: Run tests
33+
# run: dotnet test --no-build --verbosity normal
34+
35+
- name: Build
36+
run: dotnet build ${{ env.PROJECT }} -c Release

.github/workflows/pr-version.yml

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,13 @@ jobs:
1515
runs-on: ubuntu-latest
1616

1717
steps:
18-
# 1️⃣ Checkout full history and all tags
18+
# Checkout full history and all tags
1919
- uses: actions/checkout@v4
2020
with:
2121
fetch-depth: 0
2222
fetch-tags: true
2323

24-
# 2️⃣ Get latest tag and calculate next version
24+
# Get latest tag and calculate next version
2525
- name: Get latest tag and bump type
2626
id: version
2727
run: |
@@ -64,13 +64,9 @@ jobs:
6464
echo "type=$type"
6565
fi
6666
67-
# 4️⃣ Comment predicted version on PR
6867
- name: Comment version preview
6968
uses: peter-evans/create-or-update-comment@v4
7069
with:
7170
issue-number: ${{ github.event.pull_request.number }}
7271
body: |
73-
🧩 **Version Preview**
74-
Current latest tag: `${{ steps.version.outputs.current }}`
75-
PR labels: `${{ join(github.event.pull_request.labels.*.name, ', ') }}`
76-
➡️ **Predicted next version on merge:** **${{ steps.version.outputs.next }}**
72+
**Next version:** **${{ steps.version.outputs.next }}**

0 commit comments

Comments
 (0)