Skip to content

Commit

Permalink
Make Testmo actions self-contained (#41)
Browse files Browse the repository at this point in the history
* Fix README example

* Use checks to reduce work

* Make Testmo actions self-contained

* Expand output

* Make node check command quiet

* Hide npm package funding requests
  • Loading branch information
dbarbuzzi authored Dec 12, 2024
1 parent 51ad2f8 commit ce61432
Show file tree
Hide file tree
Showing 6 changed files with 34 additions and 3 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
uses: actions/checkout@v2

- name: ACTION
uses: neuralmagic/nm-actions/ACTION@main
uses: neuralmagic/nm-actions/actions/ACTION@main
with:
config-file: .eslintrc
```
Expand Down
23 changes: 21 additions & 2 deletions actions/install-testmo/action.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,32 @@
---
name: Install Testmo CLI tool
description: Install Testmo including requirements (Node.js)
description: Install Testmo including requirements (Node.js) if necessary

runs:
using: composite
steps:
- id: check-node
shell: bash
run: |-
NEEDS_NODE=0
if ! command -v node &> /dev/null; then
NEEDS_NODE=1
echo "install-testmo - latest Node.js LTS will be installed via actions/setup-node"
else
echo "install-testmo - Node.js $(node --version) already installed"
fi
echo "NEEDS_NODE=$NEEDS_NODE" >> "$GITHUB_OUTPUT"
- uses: actions/setup-node@v4
if: ${{ steps.check-node.outputs.NEEDS_NODE == '1' }}
with:
node-version: lts/*

- shell: bash
run: |-
npm install --global @testmo/testmo-cli
if ! npx testmo --help &> /dev/null; then
npm install --global --no-fund @testmo/testmo-cli
echo "install-testmo - installed testmo-cli $(npx testmo --version)"
else
echo "install-testmo - testmo-cli $(npx testmo --version) already installed"
fi
3 changes: 3 additions & 0 deletions actions/testmo-create-resources/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ inputs:
runs:
using: composite
steps:
- name: install Testmo CLI tool
uses: neuralmagic/nm-actions/actions/install-testmo@1.10.0

- name: add actions path to PATH
shell: bash
run: echo "${{ github.action_path }}" >> $GITHUB_PATH
Expand Down
3 changes: 3 additions & 0 deletions actions/testmo-run-complete/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ inputs:
runs:
using: composite
steps:
- name: install Testmo CLI tool
uses: neuralmagic/nm-actions/actions/install-testmo@1.10.0

- run: |
echo "completing TESTMO run ..."
## CHECK testmo_url and token
Expand Down
3 changes: 3 additions & 0 deletions actions/testmo-run-create/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@ outputs:
runs:
using: composite
steps:
- name: install Testmo CLI tool
uses: neuralmagic/nm-actions/actions/install-testmo@1.10.0

- name: create run
id: testmo_id
run: |
Expand Down
3 changes: 3 additions & 0 deletions actions/testmo-run-submit-thread/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@ outputs:
runs:
using: composite
steps:
- name: install Testmo CLI tool
uses: neuralmagic/nm-actions/actions/install-testmo@1.10.0

- name: add scripts folder to PATH
run: echo "${{ github.action_path }}/../../scripts" >> $GITHUB_PATH
shell: bash
Expand Down

0 comments on commit ce61432

Please sign in to comment.