docs(todo): remove TODO.md #24
Workflow file for this run
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: CI Vanilla | |
| on: | |
| push: | |
| branches: | |
| - "*/*" | |
| paths: | |
| - "vanilla/**" | |
| - ".github/workflows/ci-vanilla.yml" | |
| jobs: | |
| changed-files: | |
| runs-on: ubuntu-22.04 | |
| outputs: | |
| files: ${{ steps.filter.outputs.only_changed }} | |
| app_name: ${{ steps.env_vars.outputs.APP_NAME }} | |
| feature_name: ${{ steps.env_vars.outputs.FEATURE_NAME }} | |
| steps: | |
| - uses: actions/checkout@v4.2.2 | |
| with: | |
| fetch-depth: 2 | |
| - name: Set up Environment Variables | |
| id: env_vars | |
| run: | | |
| # NOTE: app-name matches app dirname and `.name` in `package.json` | |
| branch_name='${{ github.ref_name }}' | |
| app_name="${branch_name%/*}" # app-name/feature-name -> app-name | |
| feature_name="${branch_name#*/}" # app-name/feature-name -> feature-name | |
| echo "app_name=${app_name}" >> "$GITHUB_OUTPUT" | |
| echo "feature_name=${feature_name}" >> "$GITHUB_OUTPUT" | |
| - name: Checking for changes of ${{ env.APP_NAME }} in ${{ env.FEATURE_NAME }} | |
| uses: tj-actions/changed-files@v46.0.4 | |
| id: filter | |
| with: | |
| files: | | |
| _templates/** | |
| .github/** | |
| legacy/quote-generator/** | |
| legacy/weather-app/** | |
| legacy/github-jobs/** | |
| !.github/workflows/ci-vanilla.yml | |
| !vanilla/${{ env.APP_NAME }}/** | |
| **.md | |
| env: | |
| APP_NAME: ${{ steps.env_vars.outputs.app_name }} | |
| FEATURE_NAME: ${{ steps.env_vars.outputs.feature_name }} | |
| lint: | |
| needs: changed-files | |
| runs-on: ubuntu-22.04 | |
| if: needs.changed-files.outputs.files != 'true' | |
| steps: | |
| - uses: actions/checkout@v4.2.2 | |
| - uses: pnpm/action-setup@v4.1.0 | |
| - uses: actions/setup-node@v4.3.0 | |
| with: | |
| node-version-file: .nvmrc | |
| cache: pnpm | |
| - run: | | |
| app_name='${{ needs.changed-files.outputs.app_name }}' | |
| pnpm install --frozen-lockfile --filter "@hdoc/dev-challenges" --filter "$app_name"... | |
| pnpm run lint:vanilla vanilla/"$app_name" | |
| typecheck: | |
| needs: changed-files | |
| runs-on: ubuntu-22.04 | |
| if: needs.changed-files.outputs.files != 'true' | |
| steps: | |
| - uses: actions/checkout@v4.2.2 | |
| - uses: pnpm/action-setup@v4.1.0 | |
| - uses: actions/setup-node@v4.3.0 | |
| with: | |
| node-version-file: .nvmrc | |
| cache: pnpm | |
| - run: | | |
| app_name='${{ needs.changed-files.outputs.app_name }}' | |
| pnpm install --frozen-lockfile --filter "@hdoc/dev-challenges" --filter "$app_name"... | |
| pnpm --filter "$app_name" typecheck | |
| test-unit: | |
| needs: changed-files | |
| runs-on: ubuntu-22.04 | |
| if: needs.changed-files.outputs.files != 'true' | |
| steps: | |
| - uses: actions/checkout@v4.2.2 | |
| - uses: pnpm/action-setup@v4.1.0 | |
| - uses: actions/setup-node@v4.3.0 | |
| with: | |
| node-version-file: .nvmrc | |
| cache: pnpm | |
| - run: | | |
| app_name='${{ needs.changed-files.outputs.app_name }}' | |
| pnpm install --frozen-lockfile --filter "@hdoc/dev-challenges" --filter "$app_name"... | |
| pnpm --if-present --filter "$app_name" test:unit:ci | |
| # TODO: check test sharding | |
| # https://playwright.dev/docs/test-sharding | |
| test-e2e: | |
| needs: changed-files | |
| runs-on: ubuntu-22.04 | |
| if: needs.changed-files.outputs.files != 'true' | |
| env: | |
| APP_NAME: ${{ needs.changed-files.outputs.app_name }} | |
| steps: | |
| - uses: actions/checkout@v4.2.2 | |
| - uses: pnpm/action-setup@v4.1.0 | |
| - uses: actions/setup-node@v4.3.0 | |
| with: | |
| node-version-file: .nvmrc | |
| cache: pnpm | |
| - id: check_e2e | |
| run: | | |
| e2e_exists=$(grep --count test:e2e:ci vanilla/"$APP_NAME"/package.json) | |
| echo "e2e_exists=$e2e_exists" >> "$GITHUB_OUTPUT" | |
| - id: e2e_install | |
| if: steps.check_e2e.outputs.e2e_exists == '1' | |
| run: | | |
| pnpm install --frozen-lockfile --filter "@hdoc/dev-challenges" --filter "$APP_NAME"... | |
| pnpm --filter "$APP_NAME" test:e2e:ci | |
| # NOTE: playwright is used for e2e tests | |
| - uses: actions/upload-artifact@v4.6.2 | |
| if: ${{ !cancelled() && failure() }} | |
| with: | |
| name: ${{ env.APP_NAME }}--playwright-report | |
| path: vanilla/${{ env.APP_NAME }}/playwright-report/ | |
| retention-days: 30 |