BitBadger.Documents/.gitea/workflows/ci.yml

87 lines
2.6 KiB
YAML
Raw Normal View History

name: CI
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
2024-04-21 01:18:15 +00:00
env:
BBDOX__PG__PORT: 8301
jobs:
build-and-test:
runs-on: ubuntu-latest
strategy:
matrix:
postgres-version: [ "12", "13", "14", "15", "latest" ]
services:
postgres:
image: postgres:${{ matrix.postgres-version }}
2024-04-20 23:46:47 +00:00
networks:
2024-04-20 23:55:51 +00:00
- runner_overlay
env:
POSTGRES_PASSWORD: postgres
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
2024-04-21 00:06:13 +00:00
- "8301:5432"
2024-04-21 00:04:33 +00:00
steps:
- uses: actions/checkout@v3
2024-04-21 00:57:49 +00:00
- name: Setup .NET 6
uses: actions/setup-dotnet@v3
with:
dotnet-version: "6.0.x"
- name: Setup .NET 7
uses: actions/setup-dotnet@v3
with:
dotnet-version: "7.0.x"
- name: Setup .NET 8
uses: actions/setup-dotnet@v3
with:
2024-04-21 00:21:13 +00:00
dotnet-version: "8.0.x"
- name: Restore dependencies
run: dotnet restore src/BitBadger.Documents.sln
- name: Build
2024-04-21 00:21:13 +00:00
run: dotnet build src/BitBadger.Documents.sln --no-restore
- name: Test .NET 6 against PostgreSQL ${{ matrix.postgres-version }}
run: dotnet run --project src/Tests/BitBadger.Documents.Tests.fsproj -f net6.0
- name: Test .NET 7 against PostgreSQL ${{ matrix.postgres-version }}
run: dotnet run --project src/Tests/BitBadger.Documents.Tests.fsproj -f net7.0
- name: Test .NET 8 against PostgreSQL ${{ matrix.postgres-version }}
run: dotnet run --project src/Tests/BitBadger.Documents.Tests.fsproj -f net8.0
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: "8.0"
- name: Package Common Library
run: dotnet pack src/Common/BitBadger.Documents.Common.fsproj -c Release
- name: Move Common package
run: cp src/Common/bin/Release/BitBadger.Documents.Common.*.nupkg .
- name: Package PostgreSQL Library
run: dotnet pack src/Postgres/BitBadger.Documents.Postgres.fsproj -c Release
- name: Move PostgreSQL package
run: cp src/Postgres/bin/Release/BitBadger.Documents.Postgres.*.nupkg .
- name: Package SQLite Library
run: dotnet pack src/Sqlite/BitBadger.Documents.Sqlite.fsproj -c Release
- name: Move SQLite package
run: cp src/Sqlite/bin/Release/BitBadger.Documents.Sqlite.*.nupkg .
- name: Save Packages
uses: actions/upload-artifact@v3
with:
name: packages
path: |
*.nupkg