Skip to content

Github Actions and AWS PyPi Build #34

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

Merged
merged 15 commits into from
May 10, 2024
Merged

Github Actions and AWS PyPi Build #34

merged 15 commits into from
May 10, 2024

Conversation

H00N24
Copy link
Collaborator

@H00N24 H00N24 commented May 8, 2024

In this PR we're a GitHub actions pipeline that builds the cvldoc_parser package and pushes it into our private CodeArtifacts PyPi.

To avoid issues with version rewriting we're using dynamic versioning using git following the PEP440 standard as {base}(.post{distance}.dev0+{commit})? (currently 0.0.0.post208.dev0+ca38360).

If we create a new GitHub tag v2.0.2 the release build would be 2.0.2 and all further commits until the next release would be versioned as 2.0.2.post12.dev0+c3an45.

Currently, we're supporting all major platforms with basic testing. On push to master or GH release we'll build all of them and upload them to both CodeArtifacts PyPi and the GH Release page.

@ozcodes do you think we should keep the CircleCI or should we move everything to GitHub Actions?

@pickx I had to remove some Rust code as I was getting errors during the cargo test, was it expected (57fe133)?

error: unused imports: `cvl_parser`, `decl_parser`
Error:  --> src/parse/tests/cvl2.rs:1:20
  |
1 | use crate::parse::{cvl_parser, decl_parser};
  |                    ^^^^^^^^^^  ^^^^^^^^^^^
  |
  = note: `-D unused-imports` implied by `-D warnings`
  = help: to override `-D warnings` add `#[allow(unused_imports)]`

error: trait `ToSpan` is never used
Error:   --> src/parse/builder.rs:86:7
   |
86 | trait ToSpan {
   |       ^^^^^^
   |
   = note: `-D dead-code` implied by `-D warnings`
   = help: to override `-D warnings` add `#[allow(dead_code)]`

error: could not compile `cvldoc_parser_core` (lib) due to 1 previous error
warning: build failed, waiting for other jobs to finish...
error: could not compile `cvldoc_parser_core` (lib test) due to 2 previous errors```

Here is an example of a successful run:

H00N24 added 13 commits May 7, 2024 17:53
error: unused imports: `cvl_parser`, `decl_parser`
Error:  --> src/parse/tests/cvl2.rs:1:20
  |
1 | use crate::parse::{cvl_parser, decl_parser};
  |                    ^^^^^^^^^^  ^^^^^^^^^^^
  |
  = note: `-D unused-imports` implied by `-D warnings`
  = help: to override `-D warnings` add `#[allow(unused_imports)]`

error: trait `ToSpan` is never used
Error:   --> src/parse/builder.rs:86:7
   |
86 | trait ToSpan {
   |       ^^^^^^
   |
   = note: `-D dead-code` implied by `-D warnings`
   = help: to override `-D warnings` add `#[allow(dead_code)]`

error: could not compile `cvldoc_parser_core` (lib) due to 1 previous error
warning: build failed, waiting for other jobs to finish...
error: could not compile `cvldoc_parser_core` (lib test) due to 2 previous errors
@H00N24 H00N24 requested review from pickx and ozcodes May 8, 2024 19:25
@H00N24 H00N24 changed the title WIP: AWS PyPi Build Github Actions and AWS PyPi Build May 8, 2024
@H00N24 H00N24 marked this pull request as ready for review May 8, 2024 19:26
Copy link
Contributor

@ozcodes ozcodes left a comment

Choose a reason for hiding this comment

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

@H00N24 went though the ci part, overall very good, I'm all for working with github instead of circleci, I left comments about some minor things

working-directory: src/python_wrapper
run: cargo fmt --all --check
- name: Cargo Tests
if: success() || failure()
Copy link
Contributor

Choose a reason for hiding this comment

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

are there other options besides success and failure ?

Copy link
Collaborator

@pickx pickx May 9, 2024

Choose a reason for hiding this comment

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

I was also puzzled by this - https://stackoverflow.com/a/58859404 explained it:

If you don't want the function to run when you manually cancel a job [...]

maybe the suggested '!cancelled()' alternative is more readable

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yes, this is an old trick to do allow_failure: true as in Gitlab CI (run tests even if the syntax check failed). I was not using '!canceled()' as GH VS Code extension will try to reformat to "!canceled()" and then complaints that it should not start with "...

Copy link
Collaborator

@pickx pickx left a comment

Choose a reason for hiding this comment

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

nice. lgtm.

@H00N24 H00N24 merged commit 72e23fc into master May 10, 2024
4 checks passed
@H00N24 H00N24 deleted the ondrej/aws-pypi-build branch May 10, 2024 06:26
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.

3 participants