Skip to content

Commit

Permalink
try ubuntu for uploads
Browse files Browse the repository at this point in the history
  • Loading branch information
adamhathcock committed Jul 5, 2024
1 parent 4375701 commit 5fcf52b
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 8 deletions.
33 changes: 26 additions & 7 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,6 @@ jobs:

- name: ⚒️ Run build
run: ./build.ps1

- name: Upload coverage reports to Codecov with GitHub Action
uses: codecov/codecov-action@v4
with:
file: Converters/**/coverage.xml
token: ${{ secrets.codecov_token }}

- name: ⬆️ Upload artifacts
uses: actions/upload-artifact@v4
Expand All @@ -56,4 +50,29 @@ jobs:

- id: set-version
name: Set version to output
run: echo "version=${{ env.GitVersion_FullSemVer }}" >> "$GITHUB_OUTPUT"
run: echo "version=${{ env.GitVersion_FullSemVer }}" >> "$GITHUB_OUTPUT"
test:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.0.2xx # Align with global.json (including roll forward rules)

- name: Cache Nuget
uses: actions/cache@v4
with:
path: ~/.nuget/packages
key: ${{ runner.os }}-nuget-${{ hashFiles('**/packages.lock.json') }}

- name: ⚒️ Run build
run: ./build.sh -- test-only

- name: Upload coverage reports to Codecov with GitHub Action
uses: codecov/codecov-action@v4
with:
file: Converters/**/coverage.xml
token: ${{ secrets.codecov_token }}
13 changes: 12 additions & 1 deletion Build/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
const string RESTORE = "restore";
const string BUILD = "build";
const string TEST = "test";
const string TEST_ONLY = "test-only";
const string FORMAT = "format";
const string ZIP = "zip";
const string VERSION = "version";
Expand Down Expand Up @@ -115,7 +116,17 @@ void RemoveDirectory(string d)
Glob.Files(".", "**/*.Tests.csproj"),
file =>
{
Run("dotnet", $"test {file} -c Release --no-build --no-restore --verbosity=normal /p:AltCover=true");
Run("dotnet", $"test {file} -c Release --no-build --no-restore --verbosity=normal");
}
);

Target(
TEST_ONLY,
DependsOn(RESTORE),
Glob.Files(".", "**/*.Tests.csproj"),
file =>
{
Run("dotnet", $"test {file} -c Release --no-restore --verbosity=normal /p:AltCover=true");
}
);

Expand Down

0 comments on commit 5fcf52b

Please sign in to comment.