Skip to content

Commit 619f3d4

Browse files
Add CI workflows and update .gitignore
Add GitHub Actions workflows: test.yml runs on push/PR for main/master and executes .NET 8 restore, tests with XPlat code coverage and posts a coverage summary; release.yml triggers on tagged pushes (v*), runs restore/tests, extracts tag version, publishes, zips output and creates a GitHub Release. Update .gitignore to replace legacy NetChecksumUtils zip patterns with PhoneNumberValidator_Asset/v* entries, keep general zip exclusion, and add .claude/ and related cleanup entries.
1 parent 0a398ad commit 619f3d4

3 files changed

Lines changed: 129 additions & 3 deletions

File tree

.github/workflows/release.yml

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
tags:
6+
- "v*"
7+
8+
permissions:
9+
contents: write
10+
11+
env:
12+
PROJECT_NAME: OutSystems.PhoneNumberValidator
13+
PRODUCT_NAME: PhoneNumberValidator
14+
15+
jobs:
16+
release:
17+
runs-on: ubuntu-latest
18+
19+
steps:
20+
- name: Checkout code
21+
uses: actions/checkout@v4
22+
23+
- name: Setup .NET
24+
uses: actions/setup-dotnet@v4
25+
with:
26+
dotnet-version: 8.0.x
27+
28+
- name: Restore dependencies
29+
run: dotnet restore ${{ env.PROJECT_NAME }}/${{ env.PROJECT_NAME }}.sln -r linux-x64
30+
31+
- name: Run tests
32+
run: |
33+
dotnet test ${{ env.PROJECT_NAME }}.UnitTests/${{ env.PROJECT_NAME }}.UnitTests.csproj \
34+
--configuration Release \
35+
--no-restore \
36+
--nologo \
37+
--collect:"XPlat Code Coverage" \
38+
--results-directory ./coverage
39+
40+
- name: Code Coverage Summary
41+
uses: irongut/CodeCoverageSummary@v1.3.0
42+
with:
43+
filename: coverage/**/coverage.cobertura.xml
44+
badge: true
45+
format: markdown
46+
output: both
47+
48+
- name: Write coverage to summary
49+
run: cat code-coverage-results.md >> $GITHUB_STEP_SUMMARY
50+
51+
- name: Extract version from tag
52+
id: version
53+
run: echo "VERSION=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT
54+
55+
- name: Publish
56+
run: |
57+
dotnet publish ${{ env.PROJECT_NAME }}/${{ env.PROJECT_NAME }}.csproj \
58+
-c Release \
59+
-r linux-x64 \
60+
--self-contained false \
61+
--no-restore \
62+
-o ./publish
63+
64+
- name: Create ZIP archive
65+
run: |
66+
cd ./publish
67+
zip -r ../${{ env.PRODUCT_NAME }}_${{ steps.version.outputs.VERSION }}.zip .
68+
69+
- name: Create GitHub Release
70+
uses: softprops/action-gh-release@v2
71+
with:
72+
generate_release_notes: true
73+
files: ${{ env.PRODUCT_NAME }}_${{ steps.version.outputs.VERSION }}.zip

.github/workflows/test.yml

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
name: Test
2+
3+
on:
4+
push:
5+
branches: [main, master]
6+
pull_request:
7+
branches: [main, master]
8+
workflow_dispatch:
9+
10+
env:
11+
PROJECT_NAME: OutSystems.PhoneNumberValidator
12+
PRODUCT_NAME: PhoneNumberValidator
13+
14+
jobs:
15+
test:
16+
runs-on: ubuntu-latest
17+
18+
steps:
19+
- name: Checkout code
20+
uses: actions/checkout@v4
21+
22+
- name: Setup .NET
23+
uses: actions/setup-dotnet@v4
24+
with:
25+
dotnet-version: 8.0.x
26+
27+
- name: Restore dependencies
28+
run: dotnet restore ${{ env.PROJECT_NAME }}.UnitTests/${{ env.PROJECT_NAME }}.UnitTests.csproj
29+
30+
- name: Run tests
31+
run: |
32+
dotnet test ${{ env.PROJECT_NAME }}.UnitTests/${{ env.PROJECT_NAME }}.UnitTests.csproj \
33+
--configuration Release \
34+
--no-restore \
35+
--nologo \
36+
--collect:"XPlat Code Coverage" \
37+
--results-directory ./coverage
38+
39+
- name: Code Coverage Summary
40+
uses: irongut/CodeCoverageSummary@v1.3.0
41+
with:
42+
filename: coverage/**/coverage.cobertura.xml
43+
badge: true
44+
format: markdown
45+
output: both
46+
47+
- name: Write coverage to summary
48+
run: cat code-coverage-results.md >> $GITHUB_STEP_SUMMARY

.gitignore

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,8 @@ packages/
4545
## =========================================================================
4646

4747
# Specific requested patterns
48-
NetChecksumUtils_Asset.zip
49-
NetChecksumUtils_v*.zip
48+
PhoneNumberValidator_Asset.zip
49+
PhoneNumberValidator_v*.zip
5050

5151
# General safety for all compressed files
5252
*.zip
@@ -87,4 +87,9 @@ appsettings.Development.json
8787
TestResults/
8888
*.sequenced
8989
*.coverage
90-
*.opencoverxml
90+
*.opencoverxml
91+
92+
## =========================================================================
93+
## Claude Code
94+
## =========================================================================
95+
.claude/

0 commit comments

Comments
 (0)