Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 20 additions & 21 deletions .github/workflows/dotnet.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,28 +5,27 @@ name: .NET

on:
push:
branches: [ "main" ]
branches: ["main"]
pull_request:
branches: [ "main" ]
branches: ["main"]

jobs:
build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.0.x
- name: Restore dependencies
run: dotnet restore
- name: Build
run: dotnet build --no-restore
- name: Test
run: dotnet test --no-build --verbosity normal
- uses: actions/checkout@v4
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.0.x
- name: Restore dependencies
run: dotnet restore
- name: Build
run: dotnet build --no-restore
- name: Test
run: dotnet test --no-build --verbosity normal

test:
runs-on: ubuntu-latest
needs: build
Expand All @@ -42,9 +41,9 @@ jobs:
- name: ReportGenerator
uses: danielpalme/ReportGenerator-GitHub-Action@5.3.7
with:
reports: 'test-result.cobertura.xml'
targetdir: 'coverage-report'
reporttypes: 'Html;JsonSummary;MarkdownSummaryGithub;Badges'
reports: "test-result.cobertura.xml"
targetdir: "coverage-report"
reporttypes: "Html;JsonSummary;MarkdownSummaryGithub;Badges"

- name: Upload coverage report artifact
uses: actions/upload-artifact@v4
Expand Down Expand Up @@ -73,7 +72,7 @@ jobs:
run: |
echo "![Coverage](./coverage-report/badge_combined.svg)" > coverage-badge.md
cat coverage-badge.md >> README.md

publish_badge:
runs-on: ubuntu-latest
needs: test
Expand All @@ -82,7 +81,7 @@ jobs:
uses: actions/checkout@v4
with:
token: ${{ secrets.GH_PAT }}
repository: 'magic5644/magic5644'
repository: "magic5644/magic5644"
ref: gh-pages

- name: download badge
Expand All @@ -98,4 +97,4 @@ jobs:
branch: gh-pages
skip_fetch: true
skip_checkout: true
file_pattern: '*.svg'
file_pattern: "*.svg"
74 changes: 37 additions & 37 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
name: Release
strategy:
matrix:
kind: ['linux', 'windows']
kind: ["linux", "windows"]
include:
- kind: linux
os: ubuntu-latest
Expand All @@ -19,48 +19,48 @@ jobs:
runs-on: ${{ matrix.os }}

steps:
- name: Checkout
uses: actions/checkout@v1
- name: Checkout
uses: actions/checkout@v1

- name: Setup dotnet
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.0.x

- name: Build on Linux
if: matrix.kind == 'linux'
run: |
tag=$(git describe --tags --abbrev=0)
release_name="CodeLineCounter-$tag-${{ matrix.target }}"
- name: Setup dotnet
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.0.x

dotnet publish CodeLineCounter/CodeLineCounter.csproj --framework net8.0 --runtime "${{ matrix.target }}" -c Release -o "$release_name" /p:PublishSingleFile=true /p:IncludeNativeLibrariesForSelfExtract=true /p:UseAppHost=true
- name: Build on Linux
if: matrix.kind == 'linux'
run: |
tag=$(git describe --tags --abbrev=0)
release_name="CodeLineCounter-$tag-${{ matrix.target }}"

tar czvf "${release_name}.tar.gz" "$release_name"
dotnet publish CodeLineCounter/CodeLineCounter.csproj --framework net8.0 --runtime "${{ matrix.target }}" -c Release -o "$release_name" /p:PublishSingleFile=true /p:IncludeNativeLibrariesForSelfExtract=true /p:UseAppHost=true

rm -r "$release_name"
tar czvf "${release_name}.tar.gz" "$release_name"

- name: Build on Windows
if: matrix.kind == 'windows'
shell: cmd
run: |
echo Setting tag and release_name
for /f "tokens=*" %%i in ('git describe --tags --abbrev^=0') do (set tag=%%i)
echo Tag is %tag%
set release_name=CodeLineCounter-%tag%-${{ matrix.target }}
echo Release name is %release_name%
rm -r "$release_name"

echo Building project
dotnet publish CodeLineCounter/CodeLineCounter.csproj --framework net8.0 --runtime ${{ matrix.target }} -c Release -o %release_name% /p:PublishSingleFile=true /p:IncludeNativeLibrariesForSelfExtract=true /p:UseAppHost=true
- name: Build on Windows
if: matrix.kind == 'windows'
shell: cmd
run: |
echo Setting tag and release_name
for /f "tokens=*" %%i in ('git describe --tags --abbrev^=0') do (set tag=%%i)
echo Tag is %tag%
set release_name=CodeLineCounter-%tag%-${{ matrix.target }}
echo Release name is %release_name%

echo Packing files
7z a -tzip "%release_name%.zip" ".\%release_name%\*"
echo Building project
dotnet publish CodeLineCounter/CodeLineCounter.csproj --framework net8.0 --runtime ${{ matrix.target }} -c Release -o %release_name% /p:PublishSingleFile=true /p:IncludeNativeLibrariesForSelfExtract=true /p:UseAppHost=true

echo Deleting output directory
rmdir /s /q "%release_name%"
echo Packing files
7z a -tzip "%release_name%.zip" ".\%release_name%\*"

- name: Publish
uses: softprops/action-gh-release@v1
with:
files: "CodeLineCounter-*"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
echo Deleting output directory
rmdir /s /q "%release_name%"

- name: Publish
uses: softprops/action-gh-release@v1
with:
files: "CodeLineCounter-*"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
125 changes: 0 additions & 125 deletions CodeLineCounter.Tests/CsvExporterTest.cs

This file was deleted.

Loading