From 3908451d6ef4ed4b103b16cec2c37d4cd392fb98 Mon Sep 17 00:00:00 2001 From: "Daniel J. Summers" Date: Mon, 27 Feb 2023 20:38:33 -0500 Subject: [PATCH] Add CI action --- .github/workflows/ci.yml | 56 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 56 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..e8eaefa --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,56 @@ +name: CI + +on: + push: + branches: [ "1.8.5.vnext" ] + pull_request: + branches: [ "1.8.5.vnext" ] + +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/Giraffe.Htmx.sln + - name: Build + run: dotnet build src/Giraffe.Htmx.sln --no-restore + - name: Test ${{ matrix.dotnet-version }} against PostgreSQL ${{ matrix.postgres-version }} + run: dotnet run --project src/Tests/Tests.fsproj -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 Common library + run: dotnet pack src/Common/Giraffe.Htmx.Common.fsproj -c Release + - name: Move Common package + run: cp src/Common/bin/Release/Giraffe.Htmx.Common.*.nupkg . + - name: Package Server library + run: dotnet pack src/Htmx/Giraffe.Htmx.fsproj -c Release + - name: Move Server package + run: cp src/Htmx/bin/Release/Giraffe.Htmx.*.nupkg . + - name: Package View Engine library + run: dotnet pack src/ViewEngine.Htmx/Giraffe.ViewEngine.Htmx.fsproj -c Release + - name: Move View Engine package + run: cp src/ViewEngine.Htmx/bin/Release/Giraffe.ViewEngine.Htmx.*.nupkg . + - name: Save Packages + uses: actions/upload-artifact@v3 + with: + name: packages + path: | + *.nupkg