Giraffe.Htmx/.github/workflows/ci.yml

58 lines
1.7 KiB
YAML
Raw Permalink Normal View History

2023-02-28 01:38:33 +00:00
name: CI
on:
push:
2024-01-31 03:48:08 +00:00
branches: [ "main", "htmx-version-2" ]
2023-02-28 01:38:33 +00:00
pull_request:
2023-02-28 01:51:51 +00:00
branches: [ "main" ]
2024-01-31 04:02:45 +00:00
workflow_dispatch:
2023-02-28 01:38:33 +00:00
jobs:
build-and-test:
runs-on: ubuntu-latest
strategy:
matrix:
2023-11-22 21:09:52 +00:00
dotnet-version: [ "6.0", "7.0", "8.0" ]
2023-02-28 01:38:33 +00:00
steps:
2024-02-12 23:29:27 +00:00
- uses: actions/checkout@v4
2023-02-28 01:38:33 +00:00
- name: Setup .NET ${{ matrix.dotnet-version }}.x
2024-02-12 23:29:27 +00:00
uses: actions/setup-dotnet@v4
2023-02-28 01:38:33 +00:00
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
2023-02-28 01:56:49 +00:00
- name: Test (.NET ${{ matrix.dotnet-version }})
2023-02-28 01:38:33 +00:00
run: dotnet run --project src/Tests/Tests.fsproj -f net${{ matrix.dotnet-version }}
publish:
runs-on: ubuntu-latest
needs: build-and-test
steps:
2024-02-12 23:29:27 +00:00
- uses: actions/checkout@v4
2023-02-28 01:38:33 +00:00
- name: Setup .NET
2024-02-12 23:29:27 +00:00
uses: actions/setup-dotnet@v4
2023-02-28 01:38:33 +00:00
with:
2024-01-31 03:58:45 +00:00
dotnet-version: "8.0"
2023-02-28 01:38:33 +00:00
- 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
2024-02-12 23:29:27 +00:00
uses: actions/upload-artifact@v4
2023-02-28 01:38:33 +00:00
with:
name: packages
path: |
*.nupkg