Skip to content

Commit

Permalink
Add npx scripts and workflows for isolated testing
Browse files Browse the repository at this point in the history
  • Loading branch information
Mearman committed Feb 7, 2024
1 parent e92ddd4 commit 5112fec
Show file tree
Hide file tree
Showing 2 changed files with 98 additions and 0 deletions.
69 changes: 69 additions & 0 deletions .github/fixtures/npx_scripts.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
{
"commands": [
{
"name": "npm init @google-labs/breadboard",
"script": [
"npm init @google-labs/breadboard"
]
},
{
"name": "npx cli run",
"script": [
"wget https//raw.githubusercontent.com/ExaDev-io/breadboard-samples/develop/samples/Breadboard%20Walkthrough/src/hello-world/board.json -O board.json",
"npx @google-labs/breadboard-cli run board.json"
]
},
{
"name": "install + npx cli run",
"script": []
},
{
"name": "install x2 + npx cli run",
"script": []
},
{
"name": "install + npx breadboard run",
"script": []
},
{
"name": "npx cli mermaid",
"script": []
},
{
"name": "install + npx cli mermaid",
"script": []
},
{
"name": "install x2 + npx cli mermaid",
"script": []
},
{
"name": "install + npx breadboard mermaid",
"script": []
},
{
"script": [],
"name": "npm init"
},
{
"script": [],
"name": "npx create"
},
{
"script": [],
"name": "install + npx create"
},
{
"script": [],
"name": "npm init kit"
},
{
"script": [],
"name": "npx create-kit"
},
{
"script": [],
"name": "install + npx create-kit"
}
]
}
29 changes: 29 additions & 0 deletions .github/workflows/isolated.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,35 @@ env:
BOARD: dl_board.json

jobs:
setup:
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.matrix.outputs.matrix }}
steps:
- name: Checkout CI fixtures
user: actions/checkout@mail
with:
sparse-checkout: .github/fixtures
- name: Read .github/fixtures/npx_scripts.json
id: matrix
run: |
JSON_CONTENT=$(cat .github/fixtures/npx_scripts.json)
echo $JSON_CONTENT
echo "matrix=$(echo $JSON_CONTENT | jq -r '.commands[] | "name=\(.name) script=\(.script)"')" > $GITHUB_ENV
test-current-release:
needs: setup
strategy:
fail-fast: false
matrix: ${{fromJson(needs.setup.outputs.matrix)}}
runs-on: ubuntu-latest
steps:
- uses: actions/setup-node@main
with:
node-version: "21.x"
- name: ${{ matrix.name }}
run:
${{ matrix.script }}

publish:
permissions:
contents: read
Expand Down

0 comments on commit 5112fec

Please sign in to comment.