Skip to content

Commit

Permalink
using strategies to run actions on several .NET frameworks and OS
Browse files Browse the repository at this point in the history
  • Loading branch information
tsutomi committed Feb 16, 2024
1 parent 3fb75fa commit 64c1186
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 15 deletions.
22 changes: 15 additions & 7 deletions .github/workflows/cd.yml
Original file line number Diff line number Diff line change
@@ -1,26 +1,34 @@
name: Webhooks CD

permissions:
contents: read
packages: write

on:
push:
branches: [ main ]

jobs:
build:
name: "Build and Test"
runs-on: ubuntu-latest
strategy:
fail-fast: true
matrix:
dotnet-verion: [ '6.0.x', '7.0.x', '8.0.x' ]
os: [ ubuntu-latest, windows-latest ]

runs-on: ${{ matrix.os }}

steps:
- uses: actions/checkout@v3

- name: Setup .NET
- name: Setup .NET ${{ matrix.dotnet-version }}}
uses: actions/setup-dotnet@v3
with:
dotnet-version: |
6.0.x
7.0.x
dotnet-version: ${{ matrix.dotnet-version }}

- name: Add Deveel GitHub NuGet Source
run: dotnet nuget add source "https://nuget.pkg.github.com/deveel/index.json" -n "Deveel GitHub" -u ${{ secrets.DEVEEL_NUGET_USER }} -p ${{ secrets.DEVEEL_NUGET_TOKEN }} --store-password-in-clear-text
# - name: Add Deveel GitHub NuGet Source
# run: dotnet nuget add source "https://nuget.pkg.github.com/deveel/index.json" -n "Deveel GitHub" -u ${{ secrets.DEVEEL_NUGET_USER }} -p ${{ secrets.DEVEEL_NUGET_TOKEN }} --store-password-in-clear-text

- name: Restore dependencies
run: dotnet restore
Expand Down
24 changes: 16 additions & 8 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
@@ -1,26 +1,34 @@
name: Webhooks PR Build

permissions:
contents: read
packages: read

on:
pull_request:
branches: [ main ]

jobs:
build:
name: "Build and Test"
runs-on: ubuntu-latest
strategy:
fail-fast: true
matrix:
dotnet-verion: [ '6.0.x', '7.0.x', '8.0.x' ]
os: [ ubuntu-latest, windows-latest ]

runs-on: ${{ matrix.os }}

steps:
- uses: actions/checkout@v3

- name: Setup .NET
- name: Setup .NET ${{ matrix.dotnet-version }}}
uses: actions/setup-dotnet@v3
with:
dotnet-version: |
6.0.x
7.0.x
dotnet-version: ${{ matrix.dotnet-version }}

- name: Add Deveel GitHub NuGet Source
run: dotnet nuget add source "https://nuget.pkg.github.com/deveel/index.json" -n "Deveel GitHub" -u ${{ secrets.DEVEEL_NUGET_USER }} -p ${{ secrets.DEVEEL_NUGET_TOKEN }} --store-password-in-clear-text
# - name: Add Deveel GitHub NuGet Source
# run: dotnet nuget add source "https://nuget.pkg.github.com/deveel/index.json" -n "Deveel GitHub" -u ${{ secrets.DEVEEL_NUGET_USER }} -p ${{ secrets.DEVEEL_NUGET_TOKEN }} --store-password-in-clear-text

- name: Restore dependencies
run: dotnet restore
Expand All @@ -29,4 +37,4 @@ jobs:
run: dotnet build --no-restore -c Release

- name: Test
run: dotnet test --no-build --verbosity normal -c Release /p:CollectCoverage=true /p:CoverletOutputFormat=opencover /p:Exclude="[*.XUnit]*"
run: dotnet test --no-build --verbosity normal -c Release

0 comments on commit 64c1186

Please sign in to comment.