Skip to content

Commit 086f838

Browse files
committed
Updated workflow scripts
1 parent 53b5c47 commit 086f838

2 files changed

Lines changed: 95 additions & 8 deletions

File tree

.github/workflows/release.yml

Lines changed: 39 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,13 @@ name: Build and Package Release
33
on:
44
push:
55
tags:
6-
- 'v*' # Triggers on v1.0, v2.1.5, etc.
6+
- 'v*'
77

88
jobs:
99
release:
1010
runs-on: ubuntu-latest
1111
permissions:
12-
contents: write # Needed to create the release and upload assets
13-
12+
contents: write
1413
steps:
1514
- name: Checkout Code
1615
uses: actions/checkout@v4
@@ -20,16 +19,48 @@ jobs:
2019
with:
2120
dotnet-version: '8.0.x'
2221

22+
# 1. Restore the solution (or both projects) for the target runtime
23+
- name: Restore dependencies
24+
run: dotnet restore OutSystems.YAEmailValidator/OutSystems.YAEmailValidator.sln -r linux-x64
25+
26+
# --- THE GATEKEEPER: RUN TESTS ---
27+
28+
- name: Run Tests
29+
# If this fails, the workflow stops here and no release is created
30+
run: |
31+
dotnet test OutSystems.YAEmailValidator.UnitTests/OutSystems.YAEmailValidator.UnitTests.csproj \
32+
--configuration Release \
33+
--no-restore \
34+
--nologo \
35+
--collect:"XPlat Code Coverage" \
36+
--results-directory ./coverage
37+
38+
- name: Report Code Coverage (Optional Summary)
39+
uses: irongut/CodeCoverageSummary@v1.3.0
40+
with:
41+
filename: coverage/**/coverage.cobertura.xml
42+
badge: true
43+
format: markdown
44+
output: both
45+
46+
- name: Write Summary
47+
run: cat code-coverage-results.md >> $GITHUB_STEP_SUMMARY
48+
49+
# --- PACKAGING STEPS (Only runs if tests pass) ---
2350
- name: Get Version from Tag
2451
id: get_version
2552
run: echo "VERSION=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT
2653

2754
- name: Publish App
28-
# We publish to a local 'publish' folder
29-
run: dotnet publish OutSystems.YAEmailValidator/OutSystems.YAEmailValidator.csproj -c Release -r linux-x64 --self-contained false -o ./publish
30-
55+
run: |
56+
dotnet publish OutSystems.YAEmailValidator/OutSystems.YAEmailValidator.csproj \
57+
-c Release \
58+
-r linux-x64 \
59+
--self-contained false \
60+
--no-restore \
61+
-o ./publish
62+
3163
- name: Create Versioned Zip
32-
# This creates YAEmailValidator_v1.0.0.zip (or whatever your tag is)
3364
run: |
3465
cd ./publish
3566
zip -r ../YAEmailValidator_${{ steps.get_version.outputs.VERSION }}.zip .
@@ -38,7 +69,7 @@ jobs:
3869
- name: Create GitHub Release
3970
uses: softprops/action-gh-release@v2
4071
with:
41-
files: YAEmailValidator_${{ steps.get_version.outputs.VERSION }}.zip
72+
files: NetChecksumUtils_${{ steps.get_version.outputs.VERSION }}.zip
4273
name: Release ${{ steps.get_version.outputs.VERSION }}
4374
draft: false
4475
prerelease: false

.github/workflows/test.yml

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
name: CI - Run Tests
2+
3+
on:
4+
push:
5+
branches: [ main, master ]
6+
pull_request:
7+
branches: [ main, master ]
8+
workflow_dispatch:
9+
10+
jobs:
11+
test:
12+
name: Unit Tests
13+
runs-on: ubuntu-latest
14+
15+
steps:
16+
- name: Checkout Code
17+
uses: actions/checkout@v4
18+
19+
- name: Setup .NET
20+
uses: actions/setup-dotnet@v4
21+
with:
22+
dotnet-version: '8.0.x'
23+
24+
- name: Restore dependencies
25+
run: dotnet restore OutSystems.YAEmailValidator.UnitTests/OutSystems.YAEmailValidator.UnitTests.csproj
26+
27+
- name: Run Tests
28+
run: |
29+
dotnet test OutSystems.YAEmailValidator.UnitTests/OutSystems.YAEmailValidator.UnitTests.csproj \
30+
--configuration Release \
31+
--no-restore \
32+
--nologo \
33+
--collect:"XPlat Code Coverage" \
34+
--results-directory ./coverage
35+
36+
- name: Report Code Coverage
37+
uses: irongut/CodeCoverageSummary@v1.3.0
38+
with:
39+
filename: coverage/**/coverage.cobertura.xml
40+
badge: true
41+
fail_below_min: false
42+
format: markdown
43+
output: both
44+
45+
- name: Write Summary
46+
run: cat code-coverage-results.md >> $GITHUB_STEP_SUMMARY
47+
48+
- name: Upload coverage to Codecov
49+
uses: codecov/codecov-action@v5
50+
with:
51+
# Codecov requires a token for private repos,
52+
# and it's highly recommended for public ones to avoid rate limits.
53+
token: ${{ secrets.CODECOV_TOKEN }}
54+
directory: ./coverage
55+
fail_ci_if_error: true # Stops the build if upload fails
56+
slug: Redeagle48/OutSystems.Extension.YAEmailValidator

0 commit comments

Comments
 (0)