Git Product home page Git Product logo

runn-action's Introduction

runn-action

:octocat: GitHub Action for runn

Usage

Add scenario file to your repository.

And set up a workflow file as follows and run runn on GitHub Actions.

The actions of the runn command are executed in the container.

# .github/workflows/ci.yml
name: API scenario Test

on:
  push:
    branches:
      - main
  pull_request:

jobs:
  test:
    runs-on: ubuntu-latest
    services:
      httpbin:
        image: kennethreitz/httpbin:latest
        ports:
          - 8080:80
    steps:
      -
        uses: actions/checkout@v4
      -
        uses: k2tzumi/runn-action@latest
        with:
          path_pattern: testdata/path/to/*.yml
        env:
          # Override parameters in scenario with environment variables
          # NOTE: Specify `172.17.0.1` when accessing services on the GitHub Actions host.
          END_POINT: http://172.17.0.1:8080/

Action parameters

  • command
    Required run a scenario by specifying run.
    list the contents of a scenario by specifying list.
    If loadt is specified, the scenario can be used as a load test. Default is run.
  • path_pattern
    Required Specify the path to the Runbook ( runn scenario file ).
  • debug
    Enable runtime debug output. Default is false.
  • verbose
    Enable detailed progress output. Default is false.
  • version
    This parameter specifies the version of runn.
    If this parameter is omitted, runn-action automatically selects and runs the same version of runn as its own version.
  • fail-fast
    Terminates the process if a step in the scenario fails in the middle of a step. Default is false.
  • skip-test
    Scenario runs, but test is not evaluated. Default is false.
  • shuffle
    Shuffle multiple Runbooks to run with the runn command. Default is false.
  • concurrent
    Enable concurrent execution. Default is false.
  • enable-read-remote-scope
    Enable read:remote scope. Default is false.
  • enable-run-exec-scope
    Enable run:exec scope. Default is false.
  • labels
    Specify a label to narrow down the target of execution. Multiple labels can be separated by commas.

See action.yml and runn README for more details on how to runbook it.

runn-action's People

Contributors

izumisy avatar jackchuka avatar k2tzumi avatar karrybit avatar kyu08 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

runn-action's Issues

v0.100.0 or higher does not work.

Hi there,
Thank you for the wonderful tool.

Regarding the main issue, specifying v0.100.0 or higher throws an error and causes the execution to fail.
It appears to work correctly from v0.64.1 to v0.99.5.

Run k2tzumi/[email protected]
Run if [[ "v0.107.0" < "v0.64.0" ]]; then
Error: runn version v0.107.0 is not supported. Please use v0.64.0 or higher.

As far as I can confirm, the following code seems to be the problem.
It seems that the comparison is incorrect because it's treating the versions as strings, therefore "v0.100.0" < "v0.64.0" is evaluated as true.

runn-action/action.yml

Lines 61 to 67 in 3986279

- name: 'Check input parameter'
shell: 'bash'
run: |
if [[ "${{ inputs.version }}" < "v0.64.0" ]]; then
echo "Error: runn version ${{ inputs.version }} is not supported. Please use v0.64.0 or higher."
exit 1
fi

Unable to input some options

When passing the following options mentioned in the README to 'with', it results in "Unexpected input(s)" and does not function as expected:
'verbose', 'enable-run-exec-scope'

There may be other options that also cannot be used.

Here is the YAML for GitHub Actions to reproduce this issue:

name: "runn with run:exec"
on:
  pull_request: ~

jobs:
  runn-run:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: k2tzumi/runn-action@latest
        with:
          command: run
          path_pattern: '*.yml'
          verbose: true
          enable-run-exec-scope: true

runn yaml (not necessarily required)

desc: echo current date
steps:
  prepareDate:
    desc: prepare date
    exec:
      command: date +%Y-%m-%d | tr -d '\n'
    bind:
      today_full: current.stdout
  dumpDate:
    desc: echo date
    dump: today_full

You can also check this in the GitHub Actions Log of this repository
https://github.com/asayamakk/runn-action/actions/runs/10262294125/job/28391670470#step:4:1

Screen Shot 2024-08-06 at 16 53 49

(Note that login or permissions may be required to view, if unable to access it, I will invite you)

How should I pass the enable-run-exec-scope as described in the README?

Automated release operations

Automate manual release tasks

  1. Specify the version of the runn main unit in the workflow input
  2. Get runn release notes from the specified version
    If the release notes do not exist, an error is generated
  3. Change the image specification in action.yml to the specified version and generate the tag
  4. Create a release for the specified version

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.