Skip to content

feat: add CI/CD workflows with NuGet and npm publishing #25

feat: add CI/CD workflows with NuGet and npm publishing

feat: add CI/CD workflows with NuGet and npm publishing #25

Workflow file for this run

name: CI
on:
push:
branches: [main]
pull_request:
branches: [main]
concurrency:
group: ci-${{ github.ref }}
cancel-in-progress: true
jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '22'
cache: 'npm'
- name: Install npm dependencies
run: npm ci
- name: Lint and format check
run: npm run check
build:
runs-on: ubuntu-latest
needs: lint
steps:
- uses: actions/checkout@v4
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: '10.0.x'
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '22'
cache: 'npm'
- name: Download Tailwind CSS
run: bash tools/download-tailwind.sh
- name: Restore .NET
run: dotnet restore
- name: Build .NET
run: dotnet build --no-restore
- name: Install npm dependencies
run: npm ci
- name: Build frontend
run: npm run build
test-sqlite:
runs-on: ubuntu-latest
needs: build
steps:
- uses: actions/checkout@v4
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: '10.0.x'
- name: Download Tailwind CSS
run: bash tools/download-tailwind.sh
- name: Test
run: dotnet test --verbosity normal
test-postgresql:
runs-on: ubuntu-latest
needs: build
services:
postgres:
image: postgres:16
env:
POSTGRES_USER: test
POSTGRES_PASSWORD: test
POSTGRES_DB: simplemodule_test
ports:
- 5432:5432
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
steps:
- uses: actions/checkout@v4
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: '10.0.x'
- name: Download Tailwind CSS
run: bash tools/download-tailwind.sh
- name: Test with PostgreSQL
run: dotnet test --verbosity normal
env:
Database__DefaultConnection: "Host=localhost;Database=simplemodule_test;Username=test;Password=test"
- name: Verify migrations are up-to-date
working-directory: template/SimpleModule.Host
env:
Database__DefaultConnection: "Host=localhost;Database=simplemodule_test;Username=test;Password=test"
run: dotnet ef migrations has-pending-model-changes