GabrielBB / xvfb-action

Run your tests headlessly ❌🖥️
https://github.com/marketplace/actions/gabrielbb-xvfb-action
MIT License
140 stars 20 forks source link

Not able to run multiline commands with "run: |" #14

Closed s8sachin closed 2 years ago

s8sachin commented 4 years ago

Trying to run multiline gives out error Command:

- name: yarn test
        uses: GabrielBB/xvfb-action@v1.2
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
        with:
          run: |
            yarn package-ci
            yarn lint
            yarn tsc

Error:

error Command "package-ci\nyarn" not found.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

Error on os macos-latest and ubuntu-latest, but works fine on windows-latest Any solution for this please ?

hybridx commented 3 years ago

Hi @s8sachin have you tried the following?

steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
  with:
    node-version: '14'
- name: yarn test
  uses: GabrielBB/xvfb-action@v1.2
    env:
      GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
    with:
      run: |
        yarn package-ci
        yarn lint
        yarn tsc
cclauss commented 3 years ago

run: yarn package-ci && yarn lint && yarn tsc # seems to work.


Also, I cannot run commands in allow failures (|| true) mode like…

       - uses: GabrielBB/xvfb-action@v1
         with:
           run: pytest . || true
       - run: other_commands.sh

This should normally allow me to see which test are failing but also allow me to run other commands which follow.

jjshoe commented 2 years ago

When I try:

      - name: Screenshot 
        uses: GabrielBB/xvfb-action@v1
        with:
          run: |
            openscad -o frame_floor.png frame_floor.scad
            openscad -o sheet_floor.png sheet_floor.scad
            openscad -o frame_walls.png frame_walls.scad
            openscad -o house.png house.scad

I get:

/usr/bin/xvfb-run --auto-servernum openscad -o frame_floor.png frame_floor.scad
openscad -o sheet_floor.png sheet_floor.scad
openscad -o frame_walls.png frame_walls.scad
openscad -o house.png house.scad
option '--o' cannot be specified more than once
jjshoe commented 2 years ago

@s8sachin @cclauss @hybridx - I put up a PR that I believe should fix this. Waiting to hear from @GabrielBB.

GabrielBB commented 2 years ago

@jjshoe Thanks. Merged and deployed.

jjshoe commented 2 years ago

Can confirm this works, I think it's safe to close this issue: https://github.com/jjshoe/TheTiny/runs/4192635061?check_suite_focus=true