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:
push:
branches: [main]
branches:
- main
pull_request:
branches: [main]
branches:
- main
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
needs: [setup]
strategy:
matrix: ${{ fromJSON(needs.setup.outputs.matrix) }}
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
with:
directory: ${{ matrix.directory }}

View file

@ -6,41 +6,41 @@ on:
tags:
- v*
schedule:
# Run once a day at 3:00 AM EST
- cron: "0 8 * * *"
# Run once a day at 3:00 AM EST
- cron: "0 8 * * *"
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
needs: [setup]
strategy:
matrix: ${{ fromJSON(needs.setup.outputs.matrix) }}
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
with:
directory: ${{ matrix.directory }}

View file

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