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

feat: python test, lint and policy check workflows #18

Merged
merged 20 commits into from
Nov 18, 2024

Conversation

lengau
Copy link
Contributor

@lengau lengau commented Oct 23, 2024

@lengau lengau force-pushed the work/CRAFT-3602/test-workflows branch 15 times, most recently from b5dacfd to 3f143ef Compare October 23, 2024 17:35
@lengau lengau changed the title feat: python test workflow feat: python test, lint and policy check workflows Oct 23, 2024
@lengau lengau force-pushed the work/CRAFT-3602/test-workflows branch 5 times, most recently from 444d04f to a075374 Compare October 23, 2024 18:22
@lengau lengau force-pushed the work/CRAFT-3602/test-workflows branch from a075374 to e982fea Compare October 23, 2024 18:24
@lengau lengau marked this pull request as ready for review October 23, 2024 18:48
@lengau lengau force-pushed the work/CRAFT-3602/test-workflows branch from 550e805 to b594ddd Compare October 28, 2024 13:38
@lengau lengau force-pushed the work/CRAFT-3602/test-workflows branch from 799da0d to ec16d07 Compare October 29, 2024 08:13
@lengau lengau force-pushed the work/CRAFT-3602/test-workflows branch 5 times, most recently from 90d09d6 to ed9968f Compare November 13, 2024 19:06
@lengau lengau force-pushed the work/CRAFT-3602/test-workflows branch from ed9968f to a0d610e Compare November 13, 2024 19:07
@lengau lengau requested a review from tigarmo November 13, 2024 19:08
@lengau
Copy link
Contributor Author

lengau commented Nov 13, 2024

Re-requesting review from @tigarmo and @sergiusens given the changes made.

required: false
type: string
default: '["ubuntu-22.04", "ubuntu-24.04", "windows-latest", "macos-latest"]'
default: '["jammy", "noble"]'
Copy link
Contributor

Choose a reason for hiding this comment

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

don't we need to further restrict these to amd64?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We can and we needn't. I added the architectures in the self-test in order to check that we could add lists of tags, but I figured here it would be a good default to simply run the tests on the first available runner regardless of architecture.

@lengau lengau mentioned this pull request Nov 13, 2024
.github/workflows/test-python.yaml Outdated Show resolved Hide resolved
.github/workflows/lint-python.yaml Outdated Show resolved Hide resolved
.github/workflows/test-python.yaml Outdated Show resolved Hide resolved
.github/workflows/test-python.yaml Outdated Show resolved Hide resolved
.github/workflows/test-python.yaml Outdated Show resolved Hide resolved
uses: astral-sh/setup-uv@v3
with:
enable-cache: true
cache-suffix: ${{ toJSON(matrix.platform) }}
Copy link
Contributor

Choose a reason for hiding this comment

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

Based on the errors in https://github.com/canonical/starflow/actions/runs/11824136927 I think the conversion back to a JSON is giving an invalid cache key.

We could try with:

Suggested change
cache-suffix: ${{ toJSON(matrix.platform) }}
cache-suffix: ${{ matrix.platform }}

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The path doesn't exist because we're not actually using uv in those tests. This needs to be toJSON so it's a string - otherwise it fails when you have an array of tags (e.g. your platform is our self-hosted [noble, amd64]).

Copy link
Contributor

Choose a reason for hiding this comment

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

I meant that it looks like this is resolving to an invalid value:

image

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ahh, I see. Thank you! Fixed :-)

README.md Outdated Show resolved Hide resolved
.github/workflows/test-python.yaml Outdated Show resolved Hide resolved
.github/workflows/test-python.yaml Outdated Show resolved Hide resolved
@lengau lengau requested a review from upils November 15, 2024 18:36
@lengau lengau force-pushed the work/CRAFT-3602/test-workflows branch from 88d1860 to 91206f9 Compare November 15, 2024 18:37
@lengau lengau force-pushed the work/CRAFT-3602/test-workflows branch from 91206f9 to e8b4a5c Compare November 15, 2024 18:38
@lengau lengau force-pushed the work/CRAFT-3602/test-workflows branch from 8edf6fa to a5112a1 Compare November 15, 2024 19:18
Copy link
Contributor

@upils upils 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 I still have a small concern about the cache keys names, see #18 (comment)

@lengau lengau force-pushed the work/CRAFT-3602/test-workflows branch from b57d2a0 to 698fa3b Compare November 18, 2024 14:10
@sergiusens sergiusens merged commit cd64717 into canonical:main Nov 18, 2024
15 checks passed
dav3yblaz3

This comment was marked as spam.

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.

5 participants