ci(examples): automatically keep the list of example projects current (#1198)

This commit is contained in:
Joseph Cruz 2023-06-17 16:51:31 -04:00 committed by GitHub
parent acfc86d2a4
commit edddab1e51
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 63 additions and 61 deletions

View File

@ -2,42 +2,44 @@ name: Check Examples
on: on:
push: push:
branches: [main] branches:
- main
pull_request: pull_request:
branches: [main] branches:
- main
jobs: jobs:
call-with-matrix: setup:
name: Get Examples
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.set-matrix.outputs.matrix }}
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Install JQ Tool
uses: mbround18/install-jq@v1
- name: Set Matrix
id: set-matrix
run: |
examples=$(ls examples |
awk '{print "examples/" $0}' |
grep -v examples/README.md |
grep -v examples/Makefile.toml |
grep -v examples/cargo-make |
grep -v examples/gtk |
jq -R -s -c 'split("\n")[:-1]')
echo "Example Directories: $examples"
echo "matrix={\"directory\":$examples}" >> "$GITHUB_OUTPUT"
matrix-job:
name: Check name: Check
needs: [setup]
strategy: strategy:
matrix: ${{ fromJSON(needs.setup.outputs.matrix) }}
fail-fast: false fail-fast: false
matrix:
directory: [examples/counter,
examples/counter_isomorphic,
examples/counters,
examples/counters_stable,
examples/counter_without_macros,
examples/error_boundary,
examples/errors_axum,
examples/fetch,
examples/hackernews,
examples/hackernews_axum,
examples/js-framework-benchmark,
examples/leptos-tailwind-axum,
examples/login_with_token_csr_only,
examples/parent_child,
examples/router,
examples/session_auth_axum,
examples/slots,
examples/ssr_modes,
examples/ssr_modes_axum,
examples/tailwind,
examples/tailwind_csr_trunk,
examples/timer,
examples/todo_app_sqlite,
examples/todo_app_sqlite_axum,
examples/todo_app_sqlite_viz,
examples/todomvc]
uses: ./.github/workflows/run-example-task.yml uses: ./.github/workflows/run-example-task.yml
with: with:
directory: ${{ matrix.directory }} directory: ${{ matrix.directory }}

View File

@ -10,37 +10,37 @@ on:
- cron: "0 8 * * *" - cron: "0 8 * * *"
jobs: jobs:
call-with-matrix: setup:
name: Get Examples
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.set-matrix.outputs.matrix }}
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Install JQ Tool
uses: mbround18/install-jq@v1
- name: Set Matrix
id: set-matrix
run: |
examples=$(ls examples |
awk '{print "examples/" $0}' |
grep -v examples/README.md |
grep -v examples/Makefile.toml |
grep -v examples/cargo-make |
grep -v examples/gtk |
jq -R -s -c 'split("\n")[:-1]')
echo "Example Directories: $examples"
echo "matrix={\"directory\":$examples}" >> "$GITHUB_OUTPUT"
matrix-job:
name: Verify name: Verify
needs: [setup]
strategy: strategy:
matrix: ${{ fromJSON(needs.setup.outputs.matrix) }}
fail-fast: false fail-fast: false
matrix:
directory: [examples/counter,
examples/counter_isomorphic,
examples/counters,
examples/counters_stable,
examples/counter_without_macros,
examples/error_boundary,
examples/errors_axum,
examples/fetch,
examples/hackernews,
examples/hackernews_axum,
examples/js-framework-benchmark,
examples/leptos-tailwind-axum,
examples/login_with_token_csr_only,
examples/parent_child,
examples/router,
examples/session_auth_axum,
examples/slots,
examples/ssr_modes,
examples/ssr_modes_axum,
examples/tailwind,
examples/tailwind_csr_trunk,
examples/timer,
examples/todo_app_sqlite,
examples/todo_app_sqlite_axum,
examples/todo_app_sqlite_viz,
examples/todomvc]
uses: ./.github/workflows/run-example-task.yml uses: ./.github/workflows/run-example-task.yml
with: with:
directory: ${{ matrix.directory }} directory: ${{ matrix.directory }}

View File

@ -64,7 +64,7 @@ jobs:
needs: [setup] needs: [setup]
strategy: strategy:
matrix: ${{ fromJSON(needs.setup.outputs.matrix) }} matrix: ${{ fromJSON(needs.setup.outputs.matrix) }}
fail-fast: true fail-fast: false
uses: ./.github/workflows/run-example-task.yml uses: ./.github/workflows/run-example-task.yml
with: with:
directory: ${{ matrix.directory }} directory: ${{ matrix.directory }}