From f4799fbe5ec5cd81ac10fd9cfd0e57d7c7744c3e Mon Sep 17 00:00:00 2001 From: "Daniel J. Summers" Date: Sat, 8 Jul 2023 07:20:56 -0400 Subject: [PATCH] Add GitHub CI job --- .github/workflows/ci.yml | 49 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 .github/workflows/ci.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..cb928dd --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,49 @@ +name: CI + +on: + push: + branches: [ "main" ] + pull_request: + branches: [ "main" ] + +jobs: + build-and-test: + + runs-on: ubuntu-latest + + strategy: + matrix: + dotnet-version: [ "6.0", "7.0" ] + + steps: + - uses: actions/checkout@v3 + - name: Setup .NET ${{ matrix.dotnet-version }}.x + uses: actions/setup-dotnet@v3 + with: + dotnet-version: ${{ matrix.dotnet-version }}.x + - name: Restore dependencies + run: dotnet restore src/BitBadger.AspNetCore.CanonicalDomains/BitBadger.AspNetCore.CanonicalDomains.csproj + - name: Build + run: dotnet build src/BitBadger.AspNetCore.CanonicalDomains/BitBadger.AspNetCore.CanonicalDomains.csproj --no-restore +# TODO: set up tests +# - name: Test (.NET ${{ matrix.dotnet-version }}) +# run: dotnet run --project path/to/project -f net${{ matrix.dotnet-version }} + publish: + runs-on: ubuntu-latest + needs: build-and-test + steps: + - uses: actions/checkout@v3 + - name: Setup .NET + uses: actions/setup-dotnet@v3 + with: + dotnet-version: "7.0" + - name: Package library + run: dotnet pack src/BitBadger.AspNetCore.CanonicalDomains/BitBadger.AspNetCore.CanonicalDomains.csproj -c Release + - name: Move package + run: cp src/BitBadger.AspNetCore.CanonicalDomains/bin/Release/BitBadger.AspNetCore.CanonicalDomains.*.nupkg . + - name: Save Packages + uses: actions/upload-artifact@v3 + with: + name: packages + path: | + *.nupkg