Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

fix input handling #357

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Apr 4, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Clean and spruce up the integration tests a bit
- Use test-specific step ids
- Remove unused input parameters
- Provide clear output on what passed or failed, including
  a step summary for each passed test.
  • Loading branch information
mjpieters committed Apr 4, 2023
commit 806be26275e9f355e2644b1e8e22e1a546714375
26 changes: 19 additions & 7 deletions 26 .github/workflows/integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ on:

jobs:
test-return:
name: 'Integration test: return'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
Expand All @@ -18,26 +19,34 @@ jobs:
result-encoding: string
input-value: output
- run: |
if [[ "${{steps.output-set.outputs.result}}" != "output" ]]; then
echo "- Validating output is produced"
expected="output"
if [[ "${{steps.output-set.outputs.result}}" != "$expected" ]]; then
echo $'::error::\u274C' "Expected '$expected', got ${{steps.output-set.outputs.result}}"
exit 1
fi
echo $'\u2705 Test passed' | tee -a $GITHUB_STEP_SUMMARY

test-relative-require:
name: 'Integration test: relative-path require'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- id: output-set
- id: relative-require
uses: ./
with:
script: return require('./package.json').name
result-encoding: string
input-value: output
- run: |
if [[ "${{steps.output-set.outputs.result}}" != "github-script" ]]; then
echo "- Validating relative require output"
if [[ "${{steps.relative-require.outputs.result}}" != "github-script" ]]; then
echo $'::error::\u274C' "Expected '$expected', got ${{steps.relative-require.outputs.result}}"
exit 1
fi
echo $'\u2705 Test passed' | tee -a $GITHUB_STEP_SUMMARY

test-npm-require:
name: 'Integration test: npm package require'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
Expand All @@ -47,13 +56,16 @@ jobs:
key: ${{runner.os}}-npm-${{hashFiles('**/package-lock.json')}}
restore-keys: ${{runner.os}}-npm-
- run: npm ci
- id: output-set
- id: npm-require
uses: ./
with:
script: return require('@actions/core/package.json').name
result-encoding: string
input-value: output
- run: |
if [[ "${{steps.output-set.outputs.result}}" != "@actions/core" ]]; then
echo "- Validating npm require output"
expected="@actions/core"
if [[ "${{steps.npm-require.outputs.result}}" != "$expected" ]]; then
echo $'::error::\u274C' "Expected '$expected', got ${{steps.npm-require.outputs.result}}"
exit 1
fi
echo $'\u2705 Test passed' | tee -a $GITHUB_STEP_SUMMARY
Morty Proxy This is a proxified and sanitized view of the page, visit original site.