-
Notifications
You must be signed in to change notification settings - Fork 94
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: factorize CI with reusable workflows
- Loading branch information
Showing
11 changed files
with
283 additions
and
204 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
on: | ||
workflow_call: | ||
inputs: | ||
npm-package-fullname: | ||
required: true | ||
type: string | ||
os: | ||
required: true | ||
type: string | ||
# Set only one of these two inputs: | ||
node-version: | ||
required: false | ||
type: string | ||
node-version-file: | ||
required: false | ||
type: string | ||
|
||
defaults: | ||
run: | ||
shell: bash | ||
|
||
jobs: | ||
e2e-tests: | ||
runs-on: ${{ inputs.os }} | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 # required by Log4brains to work correctly (needs the whole Git history) | ||
- uses: actions/setup-node@v4 | ||
with: | ||
node-version-file: ${{ inputs.node-version-file }} | ||
node-version: ${{ inputs.node-version }} | ||
|
||
- run: npm install -g ${{ inputs.npm-package-fullname }} | ||
|
||
# TODO: test the preview and add some assertions :-) For now we just check the exit codes. Or manage to run e2e-tests/e2e-launcher.js from here | ||
- name: Tests | ||
run: | | ||
log4brains --version | ||
log4brains init --defaults | ||
log4brains adr list | ||
log4brains build |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
on: | ||
workflow_call: | ||
outputs: | ||
version: | ||
description: "Log4brains current version" | ||
value: ${{ jobs.get-log4brains-version.outputs.version }} | ||
|
||
defaults: | ||
run: | ||
shell: bash | ||
|
||
jobs: | ||
get-log4brains-version: | ||
runs-on: ubuntu-latest | ||
outputs: | ||
version: ${{ steps.get-version.outputs.version }} | ||
steps: | ||
- name: Get log4brains version from lerna.json | ||
id: get-version | ||
run: | | ||
version="$(cat lerna.json | jq -r .version)" | ||
echo "::set-output name=version::$version" |
22 changes: 22 additions & 0 deletions
22
.github/workflows/reusable-load-nodejs-supported-versions.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
on: | ||
workflow_call: | ||
outputs: | ||
node_versions: | ||
description: "Node.js versions officially supported by the project" | ||
value: ${{ jobs.load-nodejs-supported-versions.outputs.node_versions }} | ||
|
||
defaults: | ||
run: | ||
shell: bash | ||
|
||
jobs: | ||
load-nodejs-supported-versions: | ||
runs-on: ubuntu-latest | ||
outputs: | ||
node_versions: ${{ steps.get-versions.outputs.node_versions }} | ||
steps: | ||
- name: Get supported Node.js versions from JSON file | ||
id: get-versions | ||
run: | | ||
node_versions=$(cat .github/supported_nodejs_versions.json | jq -r '.versions | @json') | ||
echo "::set-output name=node_versions::$node_versions" |
Oops, something went wrong.