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

Mix include and exclude paths in workflows #10777

Open
philderbeast opened this issue Feb 1, 2025 · 2 comments
Open

Mix include and exclude paths in workflows #10777

philderbeast opened this issue Feb 1, 2025 · 2 comments

Comments

@philderbeast
Copy link
Collaborator

philderbeast commented Feb 1, 2025

On reflection and after reading about excluding paths, we know the paths that cabal-install is dependent on, why don't we switch from paths-ignore to paths?

$ cabal info cabal-install
...
    Dependencies:  ... Cabal ...
                   Cabal-syntax ...
                   cabal-install-solver ...
                   Cabal-QuickCheck ...
                   Cabal-described ... Cabal-tests ... cabal-install, ...

It is also possible to mix, to exclude and include paths.

Originally posted by @philderbeast in #10740 (comment)

That would give us a configuration something like:

    paths:
      - 'Cabal-QuickCheck/**'
      - 'Cabal-described/**'
      - 'Cabal-syntax/**'
      - 'Cabal-tests/**'
      - 'Cabal/**'
      - 'cabal-install-solver/**'
      - 'cabal-install/**'
      - '!Cabal-tests/test/**'
      - '!cabal-testsuite/PackageTests/**'
@philderbeast
Copy link
Collaborator Author

philderbeast commented Feb 16, 2025

pull_request:
paths-ignore:
- "doc/**"
- "**/README.md"
- "CONTRIBUTING.md"
- "changelog.d/**"
- "*/ChangeLog.md"
- "*/changelog.md"
- "release-notes/**"

The .github/workflows/check-sdist.yml CI job is using paths-ignore but perhaps it should be using paths?

We've seen that a *.md renaming can have a knock-on effect on a .cabal file and on the local install of cabal-install, #10740 (comment).

A cabal build Cabal-hooks doesn't make an sdist of Cabal-hooks and succeeds but cabal install cabal-install does and fails (because Cabal-hooks is in the same cabal.project).

The paths-ignore setup in .github/workflows/check-sdist.yml avoided triggering the workflow on content changes but it missed renames.

A cabal sdist all run is very quick:

$ cabal clean
$ time cabal sdist all
...
Configuration is affected by the following files:
- cabal.project
Wrote tarball sdist to
/home/.../cabal/dist-newstyle/sdist/Cabal-3.15.0.0.tar.gz
Wrote tarball sdist to
/home/.../cabal/dist-newstyle/sdist/Cabal-described-3.15.0.0.tar.gz
Wrote tarball sdist to
/home/.../cabal/dist-newstyle/sdist/Cabal-syntax-3.15.0.0.tar.gz
Wrote tarball sdist to
/home/.../cabal/dist-newstyle/sdist/Cabal-hooks-3.16.tar.gz
Wrote tarball sdist to
/home/.../cabal/dist-newstyle/sdist/cabal-install-3.15.0.0.tar.gz
Wrote tarball sdist to
/home/.../cabal/dist-newstyle/sdist/cabal-install-solver-3.15.0.0.tar.gz
Wrote tarball sdist to
/home/.../cabal/dist-newstyle/sdist/buildinfo-reference-generator-0.tar.gz
Wrote tarball sdist to
/home/.../cabal/dist-newstyle/sdist/Cabal-QuickCheck-3.15.0.0.tar.gz
Wrote tarball sdist to
/home/.../cabal/dist-newstyle/sdist/Cabal-tests-3.tar.gz
Wrote tarball sdist to
/home/.../cabal/dist-newstyle/sdist/Cabal-tree-diff-3.15.0.0.tar.gz
Wrote tarball sdist to
/home/.../cabal/dist-newstyle/sdist/cabal-validate-1.0.0.tar.gz
Wrote tarball sdist to
/home/.../cabal/dist-newstyle/sdist/cabal-testsuite-3.tar.gz
Wrote tarball sdist to
/home/.../cabal/dist-newstyle/sdist/cabal-benchmarks-3.tar.gz
Wrote tarball sdist to
/home/.../cabal/dist-newstyle/sdist/solver-benchmarks-3.tar.gz

________________________________________________________
Executed in  563.11 millis    fish           external
   usr time  329.04 millis  409.00 micros  328.63 millis
   sys time  151.75 millis   93.00 micros  151.66 millis

@ulysses4ever
Copy link
Collaborator

Hey @philderbeast!

CI job is using paths-ignore but perhaps it should be using paths?

Yes. Please, submit a PR.

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

Successfully merging a pull request may close this issue.

3 participants