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: Start using github actions for CI #235

Merged
merged 53 commits into from
Oct 5, 2020
Merged

ci: Start using github actions for CI #235

merged 53 commits into from
Oct 5, 2020

Conversation

flub
Copy link
Contributor

@flub flub commented Jun 10, 2020

Almost comprehensive replacement of CI in github actions:

TODO:

  • AWS and GCS keys to allow integration tests against them
  • Zeus docs upload
  • Zeus webook notifications

#skip-changelog

@flub flub marked this pull request as ready for review June 10, 2020 10:21
@flub flub requested a review from a team June 10, 2020 10:21
Copy link
Member

@Swatinem Swatinem left a comment

Choose a reason for hiding this comment

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

nice! do we care about other OSs for symbolicator? Might be good to use a matrix for that maybe? https://help.github.com/en/actions/reference/workflow-syntax-for-github-actions#jobsjob_idstrategymatrix

@flub
Copy link
Contributor Author

flub commented Jun 10, 2020

The current travis config only tests on linux, so I did the same here.

Copy link
Member

@jan-auer jan-auer left a comment

Choose a reason for hiding this comment

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

Love it, thank you so much for getting this started!

My only issue with this is that it diverges from the Makefile, which is our canonical "source of truth" for such commands. Is it possible to invoke make * commands, particularly the ones we run in Travis at the moment?

After that, if caches turn out to be stable, I'd be more than happy to remove the Travis and AppVeyor builds.

Copy link
Member

@jan-auer jan-auer left a comment

Choose a reason for hiding this comment

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

Sorry, meant to request changes.

On an unrelated note, would you mind updating the PR title? The type in the beginning should match one of the types declared here: https://develop.sentry.dev/code-review/#type. Thanks!

@flub flub changed the title maint(ci): Start using github actions for CI ci: Start using github actions for CI Jun 12, 2020
@flub
Copy link
Contributor Author

flub commented Jun 12, 2020

By using the actions-rs/cargo "action" thingy we get the integration which comments in the PR on the right locations for lints etc. If we want that functionality for the make target we'd have to write our own action I think. I'd rather be able to use the community maintained actions I think.

I imagined that we'd add another workflow with (some of) the makefile things in it before actually ditching travis. But my intention here wasn't actually to try and ditch travis, just try out the actions features for a while in parallel to see if it's worth investing in migrating and how we would like migration to look.

@flub
Copy link
Contributor Author

flub commented Jun 18, 2020

Deciding how to integrate the makefile functionality is more interesting. I'm thinking adding another workflow which invokes the makefile e2e tests is straight forward, though that already duplicates the rust tests. The overlapping linting etc is more interesting.

@flub
Copy link
Contributor Author

flub commented Jun 18, 2020

It would be nice if there was a filter you could apply to rust's and pytest's output to turn it into action-compatible errors and lints so we could run everything from the makefile. Maybe that's too crazy.

@flub flub marked this pull request as draft June 22, 2020 09:21
@flub
Copy link
Contributor Author

flub commented Aug 3, 2020

This now does everything that the travis run does, but faster. The clippy and cargofmt runs are not using the makefile so we get annotations from actions-rs. The "Rust Check" stop is entirely new and gives faster build feedback with annotations.

Bot unittest and integration tests have to do the same cargo build which should take about the same time. However because both test suites take >30s it's worth to duplicate this.

@flub flub marked this pull request as ready for review August 3, 2020 13:43
.github/workflows/ci.yml Outdated Show resolved Hide resolved
.github/workflows/ci.yml Outdated Show resolved Hide resolved
Floris Bruynooghe added 8 commits October 2, 2020 09:40
We don't (yet) build a binary.
The makefile also didn't do this.
We don't actually want to upload docs for normal PRs
@flub flub requested a review from jan-auer October 2, 2020 08:18
.github/workflows/ci.yml Show resolved Hide resolved
run: pip install --upgrade black flake8

- name: Run Black
run: black --check tests
Copy link
Member

Choose a reason for hiding this comment

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

Q: should we use this directly instead of makefile for symbolic as well?

Copy link
Member

Choose a reason for hiding this comment

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

Since we're going with explicit commands now, I would say yes. The makefile becomes an interface for the developer, and CI has it's own (equivalent or equal) commands.

.github/workflows/ci.yml Outdated Show resolved Hide resolved
pytest.skip("No AWS credentials")
msg = "No AWS credentials"
if pytestconfig.getoption("ci"):
pytest.fail(msg)
Copy link
Member

Choose a reason for hiding this comment

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

In theory this kind of stuff could be monitored by measuring coverage on the testsuite itself. Then you can find tests that are improperly skipped or not discovered at all for whatever reason.

In practice it's much harder to set up.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think that could work if you have a 100% test coverage enforced. But anything less and it probably doesn't. I like one global that you can use to potentially skip things on local workstations.

Copy link
Member

Choose a reason for hiding this comment

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

I mean testing coverage of the code in tests/, not the code that is being tested. Surely all tests are running in CI?

Copy link
Member

@jan-auer jan-auer left a comment

Choose a reason for hiding this comment

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

craft.yml still requires the following artifacts:

  • symbolicator-Linux-x86_64
  • symbolicator-Linux-x86_64-debug.zip

Unfortunately, merging like this will break releases. The artifacts were built by the release: linux x86_64 Travis job. You can either remove the craft requirement, or add the release build back.

Nothing currently produces these binaries, this is currently broken.
@flub
Copy link
Contributor Author

flub commented Oct 2, 2020

craft.yml still requires the following artifacts:

  • symbolicator-Linux-x86_64
  • symbolicator-Linux-x86_64-debug.zip

Unfortunately, merging like this will break releases. The artifacts were built by the release: linux x86_64 Travis job. You can either remove the craft requirement, or add the release build back.

Deleted these two from .craft.yml as I think things were broken since they were added.

Producing binaries opens up so many questions for me that I really would rather not mix that up into this PR. Apologies.

@flub flub requested a review from jan-auer October 2, 2020 15:11
Copy link
Member

@jan-auer jan-auer left a comment

Choose a reason for hiding this comment

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

Deleted these two from .craft.yml as I think things were broken since they were added.

I'm not sure what makes you say that. Both the build and the craft configuration look fine to me. I remember testing this when I added it. But it's up to you, we can bring this back later.

Floris Bruynooghe added 5 commits October 5, 2020 10:37
I was mistaken that this wasn't currently done.  Let's keep it.
Apparently we now have CI independently from the Makefile.
@Swatinem
Copy link
Member

Swatinem commented Oct 5, 2020

Note to self:

    Updating git repository `https://github.com/Keats/jsonwebtoken`
    Updating git repository `https://github.com/getsentry/symbolic`
    Updating git submodule `https://github.com/getsentry/breakpad`
    Updating git submodule `https://github.com/getsentry/linux-syscall-support`
    Updating git repository `https://github.com/Swatinem/cpp_demangle`
    Updating git repository `https://github.com/Swatinem/msvc-demangler-rust`
   Compiling symbolicator v0.2.0 (/home/runner/work/symbolicator/symbolicator)
   Compiling cpp_demangle v0.3.0 (https://github.com/Swatinem/cpp_demangle?branch=sentry-patches#2d274c48)
   Compiling symbolic-demangle v7.5.0 (https://github.com/getsentry/symbolic?branch=fix/demangle-fixes#737969f7)
   Compiling symbolic v7.5.0 (https://github.com/getsentry/symbolic?branch=fix/demangle-fixes#737969f7)

My cache does not support git dependencies yet, but it looks like it would be a small win here

@flub
Copy link
Contributor Author

flub commented Oct 5, 2020

Deleted these two from .craft.yml as I think things were broken since they were added.

I'm not sure what makes you say that. Both the build and the craft configuration look fine to me. I remember testing this when I added it. But it's up to you, we can bring this back later.

Ok, I read the existing travis.ymy and makefile badly again. Re-added this now. Ready to merge again I think.

I assume once this is merged with admin rights the requirement for the travis checks will disappear again?

@flub flub requested a review from jan-auer October 5, 2020 10:07
@jan-auer
Copy link
Member

jan-auer commented Oct 5, 2020

Updated branch protection rules on GitHub.

@flub flub merged commit fc776ca into master Oct 5, 2020
@flub flub deleted the maint/github-actions branch October 5, 2020 13:37
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.

4 participants