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

GitHub Action to just test on macOS, Ubuntu, and Windows #1867

Merged
merged 1 commit into from
Jan 27, 2024

Conversation

cclauss
Copy link
Contributor

@cclauss cclauss commented Jan 24, 2024

Demonstrate how to install and use just in GitHub Actions on the three major operating systems without needing third-party GitHub Actions such as https://github.com/casey/just#github-actions

Developers may be interested to run the same just commands that they use locally on continuous integration platforms such GitHub Actions. Every time that a contributor creates a pull request, just test could be run on the three major operating systems to provide feedback to both the contributor and reviewers that tests are passing.

@cclauss cclauss changed the title GitHub Action to just_polyglot on macOS, Ubuntu, and Windows GitHub Action to just polyglot on macOS, Ubuntu, and Windows Jan 24, 2024
@casey
Copy link
Owner

casey commented Jan 24, 2024

This is dope! I'm not sure we actually want to run it though as part of our own actions runs, since it will add another job when you make a PR, etc, which is already a little noisy with five jobs. How about moving this to a contrib directory? It's pretty common to have a directory called contrib, which contains extras like these. I just merged #1870, which creates a contrib directory. It can be called something like contrib/github-actions-install-just.yaml.

@cclauss
Copy link
Contributor Author

cclauss commented Jan 24, 2024

Can we please run it once (to make sure it passes) before we move it into the docs somewhere?

If you merge one of the other two PRs then I update branch (below) then this action will run and we can see if all the polyglot languages are present on all three OSes.

@casey
Copy link
Owner

casey commented Jan 24, 2024

Yup, for sure. I think it just ran and it looks like it was successful.

@cclauss
Copy link
Contributor Author

cclauss commented Jan 24, 2024

OK... Should we move this code into https://github.com/casey/just/blob/master/README.md#github-actions or should we put it into a separate markdown file? Other ideas?

@casey
Copy link
Owner

casey commented Jan 25, 2024

I think we should move the full yaml file into contrib/github-actions-install-just.yaml, and link to it in the #github-actions section of the readme. Since it's probably faster to install just using a package manager that's already present on the actions runners, I think we should link to it at the beginning of the #github-actions section, before the two alternative methods.

@cclauss cclauss marked this pull request as draft January 25, 2024 10:52
@cclauss cclauss marked this pull request as ready for review January 26, 2024 15:32
@cclauss
Copy link
Contributor Author

cclauss commented Jan 26, 2024

The file that CI/pages is complaining about will exist only after this pull request is merged.

@cclauss
Copy link
Contributor Author

cclauss commented Jan 26, 2024

We can add the link from README.md in a separate PR to placate CI/pages.

@casey
Copy link
Owner

casey commented Jan 26, 2024

Okay, sorry to waffle, but looking at the workflow, I think it can be made short enough that we should just stick it in the readme, which also means we don't have to worry about a broken link.

By avoiding using a matrix, we can boil it down to:

name: install-just
on: [pull_request, push]
jobs:
  windows:
    runs-on: windows-latest
    steps:
    - run: choco install just
  macos:
    runs-on: macos-latest
    steps:
    - run: brew install just
  ubuntu:
    runs-on: ubuntu-latest
    steps:
    - run: sudo snap install --edge --classic just

Which will be pretty easy for users to insert into their existing workflow. What do you think?

@cclauss cclauss force-pushed the patch-1 branch 2 times, most recently from 88e847e to 515ef13 Compare January 27, 2024 06:31
Demonstrate how to install and use just in GitHub Actions on the three major OSes...
@cclauss cclauss changed the title GitHub Action to just polyglot on macOS, Ubuntu, and Windows GitHub Action to just test on macOS, Ubuntu, and Windows Jan 27, 2024
@cclauss
Copy link
Contributor Author

cclauss commented Jan 27, 2024

The working script is 3 lines longer than the matrix script and does not set fast-fail to false but it is easier to understand and most visitors will only be interested to use the Ubuntu bit.

@casey casey merged commit daf4520 into casey:master Jan 27, 2024
5 checks passed
@casey
Copy link
Owner

casey commented Jan 27, 2024

Nice, looks good to me! Thank you!

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.

2 participants