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

Use Shared CI Workflows #5

Merged
merged 1 commit into from
Feb 9, 2023
Merged

Conversation

rmartin16
Copy link
Member

@rmartin16 rmartin16 commented Jan 26, 2023

Changes

  • Configures Dependabot for the repo.
  • Enabled basic pre-commit checks.
  • Ensures the repo is tested against Windows Store Python.
  • Ensures Briefcase is installed from main or using appropriate git tag.
  • Implements shared workflows from Centralize More Universal CI Actions .github#8
    • pre-commit-run
    • app-build-verify

PR Checklist:

  • All new features have been tested
  • All new features have been documented
  • I have read the CONTRIBUTING.md file
  • I will abide by the code of conduct

@rmartin16 rmartin16 force-pushed the winstore-python branch 11 times, most recently from db734f9 to 879b80f Compare January 26, 2023 22:17
@rmartin16 rmartin16 marked this pull request as ready for review January 26, 2023 22:18
@rmartin16 rmartin16 force-pushed the winstore-python branch 2 times, most recently from 6639272 to 8abd9c7 Compare January 26, 2023 22:22
@rmartin16 rmartin16 marked this pull request as draft January 26, 2023 22:45
@rmartin16
Copy link
Member Author

Leaving at draft for now. The caching may not be working....and thinking about it, app packaging should probably have failed with the Windows Store Python and Briefcase from PyPI....but it's not...

Needs more investigation.

strategy:
fail-fast: false
matrix:
python_version: ["3.8", "3.9", "3.10", "3.11"]
python-version: ["3.8", "3.9", "3.10", "3.11"]
Copy link
Member

Choose a reason for hiding this comment

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

While we're here, we should probably add 3.12-dev

Copy link
Member Author

Choose a reason for hiding this comment

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

I don't think this'll work unless a binary stub is also created for 3.12.

Copy link
Member

Choose a reason for hiding this comment

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

Ah - good point; and we can't do that until there's a NuGET release of Python 3.12.

@rmartin16 rmartin16 force-pushed the winstore-python branch 4 times, most recently from ed6ca9b to 22a08f6 Compare January 27, 2023 16:36
@rmartin16 rmartin16 changed the title Run CI against Windows Store Python Run CI against Windows Store Python; Set up Dependabot Jan 27, 2023
@rmartin16
Copy link
Member Author

rmartin16 commented Jan 27, 2023

I tracked it down. The GitHub runner comes with WiX preinstalled; so, Briefcase wasn't installing and using its own version. Unsetting the WIX environment variable allows Briefcase to ignore the existing WiX install.

CI now fails for the Windows Store Python and this PR needs to wait on Briefcase v0.3.12.

CI Run using Briefcase main branch: https://github.com/beeware/briefcase-windows-app-template/actions/runs/4026447475/jobs/6921190001

@rmartin16 rmartin16 force-pushed the winstore-python branch 5 times, most recently from 5ce0b92 to 1dd7599 Compare January 27, 2023 17:28
Comment on lines 31 to 39
- name: Cache Briefcase tools
uses: actions/cache@v3.0.11
with:
key: briefcase-${{ matrix.platform }}-${{ matrix.python_version }}
key: briefcase-${{ runner.os }}-${{ matrix.python-version }}
path: |
~/.cookiecutters
${{ matrix.briefcase-data-dir }}
${{ matrix.pip-cache-dir }}
${{ matrix.docker-cache-dir }}
~/AppData/Local/BeeWare/briefcase/Cache
~/AppData/Local/pip/Cache

Copy link
Member Author

Choose a reason for hiding this comment

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

While caching the Briefcase cache directory nullifies a lot of the rationale for testing against Windows Store Python, it still seemed like a good idea to keep in place.

Github caches are evicted after 7 days. Given this repo doesn't get many PRs, it is likely the action will run without a cache available. I've also included the python source as part of the cache key; so, a cache will only be available for subsequent runs if a previous run succeeded. This helps avoid papering over a failure because the next run would pull the successfully created cache from the github python job.

@rmartin16 rmartin16 changed the title Run CI against Windows Store Python; Set up Dependabot Run CI against Windows Store Python; Set up Dependabot (Waiting on Briefcase v0.3.12) Jan 27, 2023
@rmartin16 rmartin16 marked this pull request as ready for review January 27, 2023 18:23
Copy link
Member

@freakboy3742 freakboy3742 left a comment

Choose a reason for hiding this comment

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

These changes look good; it's currently failing CI due to a timeout running WiX - but I'm not sure if that's just Github having a moment. I've kicked off a re-run just in case.

Good catch on the fact that this is dependent on Briefcase 0.3.12 at present; while "waiting" will fix the problem, I actually think the bigger problem is that the template should be running with the dev version of Briefcase, not a formal release. The main branch of the template will be used by the main branch of Briefcase; so that should probably be reflected in our CI as well.

The only reason we should be using an officially tagged Briefcase version in CI is when we're merging into a specific branch (i.e., a fix to the 0.3.11 template branch), and that version number has been tagged in the Briefcase repo (e.g., when we cut the 0.3.12 branch, there will be a short window where the 0.3.12 branch exists, but Briefcase 0.3.12 hasn't been released yet). In all other cases (merging to main, merging to a pre-release Briefcase), we should be installing the current dev version of Briefcase.

@rmartin16
Copy link
Member Author

These changes look good; it's currently failing CI due to a timeout running WiX - but I'm not sure if that's just Github having a moment. I've kicked off a re-run just in case.

It's timing out because WiX is failing to launch heat.exe because it's looking for it in the wrong place. With a GUI, you get that dialog error message....in GH CI, it just locks up.

I'll see about getting Briefcase dev installed for testing.

@freakboy3742
Copy link
Member

It occurs to me that the Github actions logic to determine "install the version of Briefcase that matches the branch of this PR" is going to be moderately complex logic that we will probably want to use in every template; so it's a good candidate for factoring out into the .github repo.

@rmartin16 rmartin16 changed the title Run CI against Windows Store Python; Set up Dependabot (Waiting on Briefcase v0.3.12) Run CI against Windows Store Python; Set up Dependabot Feb 3, 2023
@rmartin16 rmartin16 force-pushed the winstore-python branch 5 times, most recently from 57bc64c to 9e556b5 Compare February 6, 2023 05:04
@rmartin16 rmartin16 marked this pull request as draft February 6, 2023 05:58
@rmartin16 rmartin16 changed the title Run CI against Windows Store Python; Set up Dependabot Use shared CI workflows Feb 6, 2023
@rmartin16 rmartin16 changed the title Use shared CI workflows Use Shared CI Workflows Feb 6, 2023
@rmartin16 rmartin16 force-pushed the winstore-python branch 2 times, most recently from 4bb69ba to 8a67cc7 Compare February 6, 2023 20:41
@rmartin16 rmartin16 marked this pull request as ready for review February 8, 2023 03:20
@freakboy3742 freakboy3742 merged commit fa54ead into beeware:main Feb 9, 2023
@rmartin16 rmartin16 deleted the winstore-python branch February 9, 2023 01:59
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