Skip to content
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

Add prefix input #24

Merged
merged 8 commits into from
Dec 14, 2020
Merged

Add prefix input #24

merged 8 commits into from
Dec 14, 2020

Conversation

SaschaMann
Copy link
Member

This allows inserting commands like xvfb-run in front of the Julia command

(fixes #3)


I don't know how xvfb-run works, this implements the solution from #3. I'd appreciate it if someone who needs this feature could do a test build to verify that it works. (Change uses: julia-actions/julia-runtest@v1 to uses: julia-actions/julia-runtest@prefix on a branch of your project to do that).


(cc @colinxs)

Copy link
Member

@DilumAluthge DilumAluthge left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, but as you mention in your post, it would be good to see a successful real-world build before merging.

This allows inserting commands like xvfb-run in front of the Julia command

(fixes #3)
@codecov-io
Copy link

codecov-io commented Dec 9, 2020

Codecov Report

Merging #24 (c8e82e0) into master (2e52c26) will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff            @@
##            master       #24   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files            1         1           
  Lines            2         2           
=========================================
  Hits             2         2           

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 2e52c26...c8e82e0. Read the comment docs.

@timholy
Copy link
Member

timholy commented Dec 12, 2020

I have a use-case in timholy/ProfileView.jl#161. It's not working ATM, but happy to be a guinea pig. At the moment it fails on ubuntu-latest with

/home/runner/work/_temp/9e3ae815-3fa0-4631-b50e-28e7dfe4bff2.sh: line 4: xvfb-run julia: command not found

and it breaks macOS and windows. How should we support conditional prefixes?

@SaschaMann
Copy link
Member Author

Looks like bash treats xvfb-run julia as a command that contains a space, which I didn't even know was possible. I've asked some people who are more familiar with bash if there's a proper way to handle this, and it seems like bash arrays are the answer. I'll update the script in the next commit.

How should we support conditional prefixes?

While it adds some initial burden to the user, I feel like handling this on the workflow level might be the way to go. Either via a different build matrix:

    strategy:
      matrix:
        julia-version: ['1.0', '1.2.0', '^1.3.0-rc1']
        os: [windows-latest, macOS-latest]
        include:
          - os: ubuntu-latest
            julia-version: ['1']
            prefix: 'xvfb-run'

or via an additional step that determines the prefix:

    steps:
      - uses: actions/checkout@v2
      ...
      - id: prefix_check
        run: [ "${{ runner.os }}" == "Linux" ] && echo "::set-output name=prefix::xvfb-run"
      ...
        with:
          prefix: ${{ steps.prefix_check.outputs.prefix }}

(I much prefer the first option)

SaschaMann and others added 2 commits December 12, 2020 20:08
Co-authored-by: Isaac Good <github@isaacgood.com>
Co-authored-by: Isaac Good <github@isaacgood.com>
@SaschaMann
Copy link
Member Author

I have a use-case in timholy/ProfileView.jl#161. It's not working ATM, but happy to be a guinea pig.

I think 3dc8da1 fixes it, could you re-run the build to check?

@timholy
Copy link
Member

timholy commented Dec 12, 2020

Hmm, the prefix seems to be applied to the ones not in the include statement; the only one that passed was the single Ubuntu run.

Turns out this adds double quotes if the workflow file contains quotes,
which is sometimes necessary.

This reverts commit 09fceda.
@SaschaMann
Copy link
Member Author

SaschaMann commented Dec 13, 2020

Hmm, the prefix seems to be applied to the ones not in the include statement; the only one that passed was the single Ubuntu run.

The julia-runtest step still had prefix: xvfb-run hardcoded, it should be

      - uses: julia-actions/julia-runtest@prefix
        with:
          prefix: ${{ matrix.prefix }}

I forgot about that in the example above, sorry.

Turns out there's also a better way to add additional values to certain matrix combinations:

      matrix:
        os: [ubuntu-latest, windows-latest, macOS-latest]
        version: ['1.0', '1', 'nightly']
        arch: [x64]
        include:
          - os: ubuntu-latest
            prefix: xvfb-run

This will use the standard build matrix, so you don't have to define the versions twice, but add the prefix value to all steps where os is ubuntu-latest.

I've ran a test build on a fork of your repo and it seems to work? There's a failure on macOS but I'm not sure if that's related: SaschaMann/ProfileView.jl#1 (CI build). However, I don't know the project so I can't tell if it behaves as it should.

You can copy or cherry-pick this commit to your repo to apply the changes above: SaschaMann/ProfileView.jl@27fb312

If you could verify that it indeed works, I'll merge this PR, tag a release and you can change @prefix back to @v1.

@giordano
Copy link
Member

It'd be nice to have the same for julia-actions/julia-docdeploy as well 🙂

@timholy
Copy link
Member

timholy commented Dec 14, 2020

Seems to work just fine! Looks like @giordano has used it successfully for Gtk, too. Thanks for all your help, @SaschaMann.

@DilumAluthge
Copy link
Member

@SaschaMann Good to merge now?

@SaschaMann SaschaMann merged commit b455abf into master Dec 14, 2020
@SaschaMann SaschaMann deleted the prefix branch December 14, 2020 13:01
@SaschaMann
Copy link
Member Author

Thanks for testing! I've tagged a release, it's now available via @v1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support alternate Julia commands
5 participants