mirror of
https://github.com/leptos-rs/leptos
synced 2024-11-10 14:54:16 +00:00
ci(examples): automatically keep the list of example projects current (#1198)
This commit is contained in:
parent
acfc86d2a4
commit
edddab1e51
3 changed files with 63 additions and 61 deletions
62
.github/workflows/check-examples.yml
vendored
62
.github/workflows/check-examples.yml
vendored
|
@ -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 }}
|
||||
|
|
60
.github/workflows/verify-all-examples.yml
vendored
60
.github/workflows/verify-all-examples.yml
vendored
|
@ -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 }}
|
||||
|
|
|
@ -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 }}
|
||||
|
|
Loading…
Reference in a new issue