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

CI Improvements #605

Closed
4 of 5 tasks
mwouts opened this issue Aug 30, 2020 · 8 comments · Fixed by #633
Closed
4 of 5 tasks

CI Improvements #605

mwouts opened this issue Aug 30, 2020 · 8 comments · Fixed by #633
Milestone

Comments

@mwouts
Copy link
Owner

mwouts commented Aug 30, 2020

Suggested by @chrisjsewell at #599, #601, #602

  • use rev: 19.10b0 rather than stable for black in the pre-commit hook
  • check the pre-commit hook in the CI
  • run the CI on PR initiated from other repositories than mwouts/jupytext
  • install pandoc in the pip CI using e.g. r-lib/actions/setup-pandoc
  • use tox
@Skylion007
Copy link
Contributor

Definitely agree with using a rev since pre-commit won't auto update.
Agree with checking the pre-commit hook in CI.
Once you make this repository an official pre-commit hook, you should consider testing that in .circleci too.

You can also create a build matrix of different supported Python versions in the Github actions I believe.

@mwouts
Copy link
Owner Author

mwouts commented Sep 25, 2020

I still can't find how to run the actions when

  • I push to a branch in this repo (1)
  • Or, when a PR is made
  • Except when the PR is made from one branch in this repo

I really want (1) because... my commits break the CI very often so I prefer to have the option to test them before making the pull request 😄

I've looked into https://docs.github.com/en/free-pro-team@latest/actions/reference/events-that-trigger-workflows and https://git.luolix.topmunity/t/how-to-trigger-an-action-on-push-or-pull-request-but-not-both/ . The later is very similar to what I am looking for, however I also want to see the result of the CI when I push to a branch other than master.

So unless someone has a better proposal, I'll go for the simple

on: [push, pull_request]

@chrisjsewell
Copy link
Contributor

chrisjsewell commented Sep 25, 2020

To avoid run duplication, when pushing to master from an internal branch, I always use:

on:
  push:
    branches: [master]
    tags:
      - '*'
  pull_request:

then if I'm working on another branch, you can always just create a draft PR to master, to have the CI run

@chrisjsewell
Copy link
Contributor

Also FYI, you can run pre-commit autoupdate to update all the hook versions

@mwouts
Copy link
Owner Author

mwouts commented Sep 26, 2020

Thank you @chrisjsewell !

To avoid run duplication (...)

Yes I know, this is going to create some duplication, but... ATM I do prefer that than having to create draft PR, because then every watcher is going to see how often my commits break the CI 😆

@mwouts mwouts mentioned this issue Sep 26, 2020
@mwouts
Copy link
Owner Author

mwouts commented Sep 26, 2020

@chrisjsewell , if you don't mind I will not install pandoc on the pip CI. Doing so would... reduce the code coverage! Indeed we would have any environment left in without pandoc, and we would not test any more than Jupytext can work well without pandoc 😄

@mwouts
Copy link
Owner Author

mwouts commented Sep 26, 2020

Yes I know, this is going to create some duplication

@chrisjsewell you're right, this duplication is a pain, I am trying to see if I can find another solution.

@mwouts
Copy link
Owner Author

mwouts commented Sep 27, 2020

The skip-duplicate-action seems to provide a satisfactory solution to the problem of duplicate runs... see how (exactly half) of the duplicate jobs were skipped at https://github.com/mwouts/jupytext/pull/633/checks !

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 a pull request may close this issue.

3 participants