generated from actions/typescript-action
-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Migrate internal workflow tests to shell scripts.
Using `node`/`yarn` commands _after_ loading the `volta-cli/action` is very error prone, and leads to false information.
- Loading branch information
Showing
5 changed files
with
56 additions
and
58 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,6 +6,10 @@ on: | |
- master | ||
- 'releases/*' | ||
|
||
defaults: | ||
run: | ||
shell: bash | ||
|
||
jobs: | ||
test: | ||
runs-on: ${{ matrix.os }} | ||
|
@@ -33,15 +37,15 @@ jobs: | |
with: | ||
volta-version: 0.6.3 | ||
|
||
- run: node tests/log-info.js | ||
- run: node tests/check-version.js 'volta' '0.6.3' | ||
- run: tests/log-info.sh | ||
- run: tests/check-version.sh 'volta' '0.6.3' | ||
- run: volta install [email protected] [email protected] | ||
- run: which node | ||
- run: volta which node | ||
- run: node tests/check-version.js 'node' 'v10.0.0' | ||
- run: tests/check-version.sh 'node' 'v10.0.0' | ||
- run: which yarn | ||
- run: volta which yarn | ||
- run: node tests/check-version.js 'yarn' '1.19.0' | ||
- run: tests/check-version.sh 'yarn' '1.19.0' | ||
|
||
|
||
test-no-options: | ||
|
@@ -58,15 +62,15 @@ jobs: | |
- run: npm run build | ||
- uses: ./ | ||
|
||
- run: node tests/log-info.js | ||
- run: node tests/check-version.js 'volta' 'current' | ||
- run: tests/log-info.sh | ||
- run: tests/check-version.sh 'volta' 'current' | ||
- run: volta install [email protected] [email protected] | ||
- run: which node | ||
- run: volta which node | ||
- run: node tests/check-version.js 'node' 'v12.16.1' | ||
- run: tests/check-version.sh 'node' 'v12.16.1' | ||
- run: which yarn | ||
- run: volta which yarn | ||
- run: node tests/check-version.js 'yarn' '1.19.1' | ||
- run: tests/check-version.sh 'yarn' '1.19.1' | ||
|
||
test-specific-volta: | ||
runs-on: ${{ matrix.os }} | ||
|
@@ -84,15 +88,15 @@ jobs: | |
with: | ||
volta-version: 0.7.0 | ||
|
||
- run: node tests/log-info.js | ||
- run: node tests/check-version.js 'volta' '0.7.0' | ||
- run: tests/log-info.sh | ||
- run: tests/check-version.sh 'volta' '0.7.0' | ||
- run: volta install [email protected] [email protected] | ||
- run: which node | ||
- run: volta which node | ||
- run: node tests/check-version.js 'node' 'v12.16.1' | ||
- run: tests/check-version.sh 'node' 'v12.16.1' | ||
- run: which yarn | ||
- run: volta which yarn | ||
- run: node tests/check-version.js 'yarn' '1.19.1' | ||
- run: tests/check-version.sh 'yarn' '1.19.1' | ||
|
||
test-specified-node-yarn-overrides-pinned-versions: | ||
runs-on: ${{ matrix.os }} | ||
|
@@ -120,14 +124,14 @@ jobs: | |
node-version: 12.14.0 | ||
yarn-version: 1.22.0 | ||
|
||
- run: node ./action/tests/log-info.js | ||
- run: node ./action/tests/check-version.js 'volta' '0.7.1' | ||
- run: tests/log-info.sh | ||
- run: ./action/tests/check-version.sh 'volta' '0.7.1' | ||
- run: which node | ||
- run: volta which node | ||
- run: node ./action/tests/check-version.js 'node' 'v12.14.0' | ||
- run: ./action/tests/check-version.sh 'node' 'v12.14.0' | ||
- run: which yarn | ||
- run: volta which yarn | ||
- run: node ./action/tests/check-version.js 'yarn' '1.22.0' | ||
- run: ./action/tests/check-version.sh 'yarn' '1.22.0' | ||
|
||
test-specific-volta-node-yarn: | ||
runs-on: ${{ matrix.os }} | ||
|
@@ -147,11 +151,11 @@ jobs: | |
node-version: 12.0.0 | ||
yarn-version: 1.22.0 | ||
|
||
- run: node tests/log-info.js | ||
- run: node tests/check-version.js 'volta' '0.7.1' | ||
- run: tests/log-info.sh | ||
- run: tests/check-version.sh 'volta' '0.7.1' | ||
- run: which node | ||
- run: volta which node | ||
- run: node tests/check-version.js 'node' 'v12.0.0' | ||
- run: tests/check-version.sh 'node' 'v12.0.0' | ||
- run: which yarn | ||
- run: volta which yarn | ||
- run: node tests/check-version.js 'yarn' '1.22.0' | ||
- run: tests/check-version.sh 'yarn' '1.22.0' |
This file was deleted.
Oops, something went wrong.
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,19 @@ | ||
#!/bin/bash | ||
|
||
# exit when any command fails | ||
set -e | ||
|
||
command=$1 | ||
expectedVersion=$2 | ||
|
||
if [[ "$expectedVersion" == "current" ]]; then | ||
scriptPath="$(dirname "$BASH_SOURCE")/latest-version.js" | ||
expectedVersion="$(curl --silent "https://volta.sh/latest-version")" | ||
fi | ||
|
||
actualVersion="$($command --version)" | ||
echo "Expected $expectedVersion; found $actualVersion" | ||
|
||
if [[ "$actualVersion" != "$expectedVersion" ]]; then | ||
exit 1 | ||
fi |
This file was deleted.
Oops, something went wrong.
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,13 @@ | ||
#!/bin/bash | ||
|
||
# exit when any command fails | ||
set -e | ||
|
||
echo "Current PATH: $PATH" | ||
echo "Current VOLTA_HOME: $VOLTA_HOME" | ||
|
||
voltaBinContents="$(ls $VOLTA_HOME/bin)" | ||
echo "Current contents of $VOLTA_HOME\n$voltaBinContents" | ||
echo "Path to volta: $(which volta)" | ||
echo "Path to node: $(which node)" | ||
echo "Path to yarn: $(which yarn)" |