chore(deps): update Storybook to v10.4.1 #1566
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Build | |
| # For more information on this YAML file, please reference blog: https://agramont.net/blog/devops-intro-deploy-net-aspire-azure-github-actions | |
| on: | |
| workflow_dispatch: | |
| push: | |
| # Run when commits are pushed to mainline branch (main or master) | |
| # Set this to the mainline branch you are using | |
| branches: | |
| - master | |
| - main | |
| pull_request: | |
| branches: ["dev", "master", "main"] | |
| permissions: | |
| contents: read | |
| # Based from https://docs.github.com/en/actions/use-cases-and-examples/building-and-testing/building-and-testing-net | |
| jobs: | |
| changes: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| pull-requests: read | |
| outputs: | |
| backend: ${{ steps.filter.outputs.backend || 'true' }} | |
| openapi: ${{ steps.filter.outputs.openapi || 'true' }} | |
| frontend: ${{ steps.filter.outputs.frontend || 'true' }} | |
| steps: | |
| - name: Checkout | |
| if: github.event_name == 'pull_request' | |
| uses: actions/checkout@v6 | |
| - name: Check for file changes | |
| if: github.event_name == 'pull_request' | |
| uses: dorny/paths-filter@fbd0ab8f3e69293af611ebaee6363fc25e6d187d # v4.0.1 | |
| id: filter | |
| with: | |
| filters: | | |
| backend: | |
| - 'backend/**' | |
| - '.github/workflows/main.yml' | |
| openapi: | |
| - 'backend/**' | |
| - 'ui/**' | |
| - '.github/workflows/main.yml' | |
| frontend: | |
| - 'ui/**' | |
| - 'open-api/**' | |
| - '.github/workflows/main.yml' | |
| dependency-review: | |
| if: github.event_name == 'pull_request' | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v6 | |
| - name: Dependency Review | |
| uses: actions/dependency-review-action@v4 | |
| backend-build: | |
| name: Create OpenAPI spec | |
| needs: changes | |
| if: | | |
| github.event_name != 'pull_request' || | |
| needs.changes.outputs.openapi == 'true' | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| actions: write | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v6 | |
| - name: Setup dotnet 10.x | |
| uses: actions/setup-dotnet@v5 | |
| with: | |
| dotnet-version: "10.0.x" | |
| - name: Restore | |
| run: dotnet restore MenuApi.sln | |
| working-directory: ./backend | |
| - name: Build solution (generate OpenAPI) | |
| run: dotnet build MenuApi.sln --configuration Release --no-restore | |
| working-directory: ./backend | |
| - name: Upload OpenAPI document | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| name: openapi-spec | |
| path: open-api/menu-api.json | |
| if-no-files-found: error | |
| backend-tests: | |
| name: Backend tests | |
| needs: changes | |
| if: | | |
| github.event_name != 'pull_request' || | |
| needs.changes.outputs.backend == 'true' | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| actions: read | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v6 | |
| - name: Setup dotnet 10.x | |
| uses: actions/setup-dotnet@v5 | |
| with: | |
| dotnet-version: "10.0.x" | |
| - name: Restore | |
| run: dotnet restore MenuApi.sln | |
| working-directory: ./backend | |
| - name: Build solution (generate OpenAPI) | |
| run: dotnet build MenuApi.sln --configuration Release --no-restore | |
| working-directory: ./backend | |
| - name: Test with the dotnet CLI | |
| run: dotnet test --project MenuApi.Tests/MenuApi.Tests.csproj --configuration Release --no-build | |
| working-directory: ./backend | |
| backend-integration-tests: | |
| name: Backend integration tests | |
| needs: changes | |
| if: | | |
| github.event_name != 'pull_request' || | |
| needs.changes.outputs.backend == 'true' | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| actions: read | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v6 | |
| - name: Setup dotnet 10.x | |
| uses: actions/setup-dotnet@v5 | |
| with: | |
| dotnet-version: "10.0.x" | |
| - name: Restore | |
| run: dotnet restore MenuApi.sln | |
| working-directory: ./backend | |
| - name: Build solution (generate OpenAPI) | |
| run: dotnet build MenuApi.sln --configuration Release --no-restore | |
| working-directory: ./backend | |
| - name: clean ssl cert | |
| run: dotnet dev-certs https --clean | |
| - name: trust ssl cert | |
| run: | | |
| dotnet dev-certs https --trust || true | |
| echo "SSL_CERT_DIR=$HOME/.aspnet/dev-certs/trust:${SSL_CERT_DIR:-/usr/lib/ssl/certs}" >> "$GITHUB_ENV" | |
| - name: Test with the dotnet CLI | |
| run: dotnet test --project MenuApi.Integration.Tests/MenuApi.Integration.Tests.csproj --configuration Release --no-build | |
| working-directory: ./backend | |
| env: | |
| parameters__Auth0TestClientId: ${{ vars.AUTH0_CLIENT_ID }} | |
| parameters__Auth0TestClientSecret: ${{ secrets.AUTH0_CLIENT_SECRET }} | |
| parameters__Auth0Domain: ${{ vars.AUTH0_DOMAIN }} | |
| parameters__Auth0Audience: http://localhost:65273 | |
| frontend: | |
| name: Frontend validation | |
| runs-on: ubuntu-latest | |
| needs: [changes, backend-build] | |
| if: | | |
| !cancelled() && | |
| ( | |
| github.event_name != 'pull_request' || | |
| needs.changes.outputs.openapi == 'true' || | |
| needs.changes.outputs.frontend == 'true' | |
| ) && | |
| (needs.backend-build.result == 'success' || needs.backend-build.result == 'skipped') | |
| permissions: | |
| contents: read | |
| actions: read | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v6 | |
| - name: Download OpenAPI document | |
| if: needs.backend-build.result == 'success' | |
| uses: actions/download-artifact@v8 | |
| with: | |
| name: openapi-spec | |
| path: open-api | |
| merge-multiple: true | |
| - name: Use Node.js 22.x | |
| uses: actions/setup-node@v6 | |
| with: | |
| node-version: 22.x | |
| - name: Enable pnpm with corepack | |
| run: corepack enable pnpm | |
| - name: Get pnpm store directory | |
| id: pnpm-cache | |
| run: echo "STORE_PATH=$(pnpm store path --silent)" >> "$GITHUB_OUTPUT" | |
| working-directory: ./ui/menu-website | |
| - name: Cache pnpm store | |
| uses: actions/cache@v5 | |
| with: | |
| path: ${{ steps.pnpm-cache.outputs.STORE_PATH }} | |
| key: ${{ runner.os }}-pnpm-store-${{ hashFiles('ui/menu-website/pnpm-lock.yaml', 'ui/menu-website/package.json') }} | |
| restore-keys: | | |
| ${{ runner.os }}-pnpm-store- | |
| - name: Install frontend dependencies | |
| run: pnpm install --frozen-lockfile | |
| working-directory: ./ui/menu-website | |
| - name: Generate OpenAPI types | |
| run: pnpm run generate-openapi | |
| working-directory: ./ui/menu-website | |
| - name: Lint frontend | |
| run: pnpm run lint | |
| working-directory: ./ui/menu-website | |
| - name: Build frontend | |
| run: pnpm run build | |
| working-directory: ./ui/menu-website | |
| - name: Get installed Playwright version | |
| id: playwright-version | |
| run: | | |
| PLAYWRIGHT_VERSION=$(node -p "require('playwright/package.json').version") | |
| echo "PLAYWRIGHT_VERSION=$PLAYWRIGHT_VERSION" >> "$GITHUB_OUTPUT" | |
| working-directory: ./ui/menu-website | |
| - name: Cache Playwright browsers | |
| uses: actions/cache@v5 | |
| id: playwright-cache | |
| with: | |
| path: ~/.cache/ms-playwright | |
| key: ${{ runner.os }}-playwright-${{ steps.playwright-version.outputs.PLAYWRIGHT_VERSION }} | |
| - name: Install Playwright browsers | |
| if: steps.playwright-cache.outputs.cache-hit != 'true' | |
| run: pnpm exec playwright install --with-deps | |
| working-directory: ./ui/menu-website | |
| - name: Run frontend tests | |
| run: pnpm run test | |
| working-directory: ./ui/menu-website |