Skip to content
This repository has been archived by the owner on Dec 12, 2024. It is now read-only.

Commit

Permalink
test
Browse files Browse the repository at this point in the history
  • Loading branch information
finn-block committed Jun 10, 2024
1 parent 298d039 commit 7f2a37f
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 deletions.
13 changes: 9 additions & 4 deletions .github/generate-test-steps.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,13 @@ function formatCommands(commands) {
return commands.map((c) => "echo \"::group::" + c + "\"\n" + c + "\necho \"::endgroup::\"").join("\n");
}

const languages = {};
for (const language of readdirSync('.')) {
if (!statSync(language).isDirectory()) {
continue;
}

const matrix = [];
const examples = [];

for (const example of readdirSync(language)) {
const directory = language + '/' + example
Expand All @@ -48,8 +49,12 @@ for (const language of readdirSync('.')) {
testCommands = formatCommands(testCommands);
}

matrix.push({ example, preTestCommands, testCommands });
examples.push({ example, preTestCommands, testCommands });
}

console.log(language + "=" + JSON.stringify(matrix));
}
if (examples.length > 0) {
languages[language] = examples;
}
}

console.log("languages=" + JSON.stringify(languages));
4 changes: 2 additions & 2 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ jobs:
list-projects:
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.build-matrix.outputs.result }}
languages: ${{ steps.build-matrix.outputs.result.languages }}
steps:
- uses: actions/checkout@v2
- name: discover all examples
Expand All @@ -18,7 +18,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix: ${{ fromJSON(needs.list-projects.outputs.javascript) }}
matrix: ${{ fromJSON(needs.list-projects.outputs.languages).javascript }}
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v3
Expand Down

0 comments on commit 7f2a37f

Please sign in to comment.