Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
210 changes: 105 additions & 105 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,105 +1,105 @@
name: CI

on:
push:
branches: [main, develop]
pull_request:
workflow_dispatch:

permissions:
contents: read

concurrency:
group: ci-${{ github.ref }}
cancel-in-progress: true

env:
DOTNET_NOLOGO: true
DOTNET_CLI_TELEMETRY_OPTOUT: true

jobs:
build:
name: Build and test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- uses: actions/setup-dotnet@v4
with:
dotnet-version: 10.0.x

- name: Restore
run: dotnet restore src/Taskist.sln

- name: Build
run: dotnet build src/Taskist.sln --configuration Release --no-restore

- name: Test
run: dotnet test src/Taskist.sln --configuration Release --no-build --logger "trx;LogFileName=results.trx"

- name: Check the generated dark theme is up to date
run: |
python3 tools/theme/generate-dark-css.py
git diff --exit-code -- src/Presentation/Taskist.Web/wwwroot/css/theme-dark.generated.css || { echo "::error::theme-dark.generated.css is stale. Run 'python tools/theme/generate-dark-css.py' and commit the result."; exit 1; }

- name: Check for missing migrations
run: |
dotnet tool install --global dotnet-ef --version 10.*
dotnet ef migrations has-pending-model-changes \
--project src/Libraries/Taskist.Data \
--startup-project src/Libraries/Taskist.Data \
--configuration Release \
--no-build

- name: Upload test results
if: always()
uses: actions/upload-artifact@v4
with:
name: test-results
path: "**/TestResults/*.trx"
if-no-files-found: ignore

docker:
name: Docker stack smoke test
runs-on: ubuntu-latest
needs: build
steps:
- uses: actions/checkout@v4

- name: Create .env
run: |
cp .env.example .env
sed -i "s/^MSSQL_SA_PASSWORD=.*/MSSQL_SA_PASSWORD=Ci_$(openssl rand -hex 12)Aa1!/" .env

- name: Build and start
run: docker compose up -d --build

- name: Wait for the web container to become healthy
run: |
for attempt in $(seq 1 120); do
migrate="$(docker compose ps -a --format '{{.State}} {{.ExitCode}}' migrate)"
case "$migrate" in
exited\ 0|"") ;;
exited*) echo "migrate failed: $migrate"; exit 1 ;;
esac
web="$(docker compose ps -q web)"
if [ -n "$web" ] && [ "$(docker inspect -f '{{.State.Health.Status}}' "$web")" = "healthy" ]; then
echo "web is healthy"; exit 0
fi
sleep 5
done
echo "timed out waiting for web"; exit 1

- name: Sign-in page responds
run: curl -fsS http://localhost:8080/login -o /dev/null

- name: Seeding is repeatable
run: docker compose run --rm migrate

- name: Logs
if: failure()
run: docker compose logs

- name: Tear down
if: always()
run: docker compose down -v
name: CI
on:
push:
branches: [main, develop]
pull_request:
workflow_dispatch:
permissions:
contents: read
concurrency:
group: ci-${{ github.ref }}
cancel-in-progress: true
env:
DOTNET_NOLOGO: true
DOTNET_CLI_TELEMETRY_OPTOUT: true
jobs:
build:
name: Build and test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-dotnet@v6
with:
dotnet-version: 10.0.x
- name: Restore
run: dotnet restore src/Taskist.sln
- name: Build
run: dotnet build src/Taskist.sln --configuration Release --no-restore
- name: Test
run: dotnet test src/Taskist.sln --configuration Release --no-build --logger "trx;LogFileName=results.trx"
- name: Check the generated dark theme is up to date
run: |
python3 tools/theme/generate-dark-css.py
git diff --exit-code -- src/Presentation/Taskist.Web/wwwroot/css/theme-dark.generated.css || { echo "::error::theme-dark.generated.css is stale. Run 'python tools/theme/generate-dark-css.py' and commit the result."; exit 1; }
- name: Check for missing migrations
run: |
dotnet tool install --global dotnet-ef --version 10.*
dotnet ef migrations has-pending-model-changes \
--project src/Libraries/Taskist.Data \
--startup-project src/Libraries/Taskist.Data \
--configuration Release \
--no-build
- name: Upload test results
if: always()
uses: actions/upload-artifact@v4
with:
name: test-results
path: "**/TestResults/*.trx"
if-no-files-found: ignore
docker:
name: Docker stack smoke test
runs-on: ubuntu-latest
needs: build
steps:
- uses: actions/checkout@v4
- name: Create .env
run: |
cp .env.example .env
sed -i "s/^MSSQL_SA_PASSWORD=.*/MSSQL_SA_PASSWORD=Ci_$(openssl rand -hex 12)Aa1!/" .env
- name: Build and start
run: docker compose up -d --build
- name: Wait for the web container to become healthy
run: |
for attempt in $(seq 1 120); do
migrate="$(docker compose ps -a --format '{{.State}} {{.ExitCode}}' migrate)"
case "$migrate" in
exited\ 0|"") ;;
exited*) echo "migrate failed: $migrate"; exit 1 ;;
esac
web="$(docker compose ps -q web)"
if [ -n "$web" ] && [ "$(docker inspect -f '{{.State.Health.Status}}' "$web")" = "healthy" ]; then
echo "web is healthy"; exit 0
fi
sleep 5
done
echo "timed out waiting for web"; exit 1
- name: Sign-in page responds
run: curl -fsS http://localhost:8080/login -o /dev/null
- name: Seeding is repeatable
run: docker compose run --rm migrate
- name: Logs
if: failure()
run: docker compose logs
- name: Tear down
if: always()
run: docker compose down -v
Loading