Skip to content

refactor: enhanced thunk registry system #125

refactor: enhanced thunk registry system

refactor: enhanced thunk registry system #125

Workflow file for this run

name: test-ecosystem
on:
push:
branches: main
pull_request:
branches: main
permissions:
contents: read
jobs:
test-ecosystem:
name: ${{ matrix.example.repo }}/${{ matrix.example.folder }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
example:
- owner: neurosnap
repo: starfx-examples
folder: vite-react
- owner: neurosnap
repo: starfx-examples
folder: parcel-react
- owner: neurosnap
repo: starfx-examples
folder: tests-rtl
steps:
- name: checkout main repo
uses: actions/checkout@v4
with:
repository: "neurosnap/starfx"
path: "starfx"
- name: setup deno
uses: denoland/setup-deno@v1
with:
deno-version: v1.x
# determines branch and sets it as output available through the `id`
- name: dynamically determine ${{ matrix.example.owner }}/${{ matrix.example.repo }} branch
id: conditionalBranch
shell: bash
run: deno run -A ./starfx/scripts/branch-exists.ts "$GITHUB_HEAD_REF" neurosnap/starfx-examples
- name: checkout ${{ matrix.example.owner }}/${{ matrix.example.repo }} on ${{ steps.conditionalBranch.outputs.branch }}
uses: actions/checkout@v4
with:
repository: ${{ matrix.example.owner }}/${{ matrix.example.repo }}
path: ${{ matrix.example.repo }}
ref: ${{ steps.conditionalBranch.outputs.branch }}
- name: bundle for npm
shell: bash
run: deno task npm 0.0.0
working-directory: starfx
# install in example repos
- name: install ${{ matrix.example.owner }}/${{ matrix.example.repo }}
shell: bash
working-directory: ${{ matrix.example.repo }}/${{ matrix.example.folder }}
run: npm install
# symlink example repos
- name: symlink built assets
shell: bash
run: deno task sync-build-to install ${{ matrix.example.repo }}/${{ matrix.example.folder }}
working-directory: starfx
# run build and test in example repos
- name: build ${{ matrix.example.owner }}/${{ matrix.example.repo }}
working-directory: ${{ matrix.example.repo }}/${{ matrix.example.folder }}
run: npm run build --if-present
- name: test ${{ matrix.example.owner }}/${{ matrix.example.repo }}
working-directory: ${{ matrix.example.repo }}/${{ matrix.example.folder }}
run: npm run test --if-present