Skip to content

Instantly share code, notes, and snippets.

@rpede
Created August 10, 2024 13:17
Show Gist options
  • Save rpede/af58c981aee6a21045c6c799cbd2ca59 to your computer and use it in GitHub Desktop.
Save rpede/af58c981aee6a21045c6c799cbd2ca59 to your computer and use it in GitHub Desktop.
tutorial-fullstack-ci final
name: Continuous integration
on:
push:
branches: ["main"]
pull_request:
types: [opened, synchronize, reopened, closed]
branches: ["main"]
jobs:
client_test_job:
name: Client test
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: "22"
cache: "npm"
cache-dependency-path: client/package-lock.json
- name: Install dependencies
run: npm clean-install --prefix=client
- name: Build
run: npm run build --prefix=client
- name: Test
run: npm run test --prefix=client
server_test_job:
name: Server test
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- uses: actions/checkout@v4
- uses: actions/setup-dotnet@v4
with:
dotnet-version: "8.0.x"
- name: Build
run: dotnet build
- name: Test
run: dotnet test
e2e_test_job:
name: End-to-end test
runs-on: ubuntu-latest
needs: [client_test_job, server_test_job]
timeout-minutes: 15
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: "22"
cache: "npm"
cache-dependency-path: client/package-lock.json
- uses: docker/setup-buildx-action@v3
- name: Start services
run: docker compose up -d --wait
- name: Install dependencies
run: npm clean-install --prefix=client
- name: Install browsers
run: npx --prefix=client playwright install --with-deps
- name: Run e2e tests
run: npm run e2e --prefix=client
- name: Stop services
run: docker compose down
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment