myWebLog/.github/workflows/ci.yml

53 lines
1.2 KiB
YAML
Raw Normal View History

2024-03-23 22:21:00 +00:00
name: Continuous Integration
2024-03-23 21:46:29 +00:00
on:
push:
2024-03-23 22:21:00 +00:00
branches: [ "main" ]
2024-03-23 21:46:29 +00:00
pull_request:
2024-03-23 22:21:00 +00:00
branches: [ "main" ]
2024-03-23 21:46:29 +00:00
workflow_dispatch:
jobs:
build_and_test:
name: Build / Test
runs-on: ubuntu-latest
strategy:
matrix:
2024-03-23 22:41:45 +00:00
dotnet-version:
- "6.0"
# - "7.0"
# - "8.0"
2024-03-23 21:46:29 +00:00
services:
postgres:
image: postgres:latest
env:
POSTGRES_PASSWORD: postgres
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 5432:5432
rethink:
image: rethinkdb:latest
ports:
- 28015:28015
- 29015:29015
steps:
2024-03-23 22:29:24 +00:00
- name: Check Out Code
2024-03-23 22:30:22 +00:00
uses: actions/checkout@v4
2024-03-23 21:46:29 +00:00
- name: Setup .NET Core SDK
uses: actions/setup-dotnet@v4.0.0
with:
dotnet-version: 8.x
- name: Restore dependencies
run: dotnet restore src/MyWebLog.sln
- name: Build (${{ matrix.dotnet-version }})
2024-03-23 22:37:08 +00:00
run: dotnet build src/MyWebLog.sln -f net${{ matrix.dotnet-version }}
2024-03-23 21:46:29 +00:00
- name: Test (${{ matrix.dotnet-version }})
run: dotnet run --project src/MyWebLog.Tests/MyWebLog.Tests.fsproj -f net${{ matrix.dotnet-version }}