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

Migrate from Travis to Github actions #217

Merged
merged 1 commit into from Feb 17, 2020
Merged

Migrate from Travis to Github actions #217

merged 1 commit into from Feb 17, 2020

Conversation

fao89
Copy link
Member

@fao89 fao89 commented Feb 3, 2020

Github Actions

  • Current run:
python27 - static
python36 - dynamic
python37 - upgrade

https://github.com/fabricio-aguiar/ansible-pulp/runs/423332526

  • Full run:
all python versions x all scenarios

https://github.com/fabricio-aguiar/ansible-pulp/actions/runs/33601847
* seems that all tests ran in parallel

Note:

some TRAVIS environment variables are hard to replace, like TRAVIS_COMMIT_RANGE
I still not found a way to get the commit range

@dralley
Copy link
Contributor

dralley commented Feb 3, 2020

@fabricio-aguiar re:

some TRAVIS environment variables are hard to replace, like TRAVIS_COMMIT_RANGE

I think there's a GITHUB_SHA environment variable. I've also seen references to github.event.head_commit.message (an intrinsic that you would need to store as an environment variable) but I can't find any documentation for the latter.

@fao89
Copy link
Member Author

fao89 commented Feb 3, 2020

@fabricio-aguiar re:

You'll probably need to do something like:

- name: Store Commit SHA
 env:
    TRAVIS_COMMIT_SHA: ${{ github.sha }}

Which should give you The commit SHA that triggered the workflow run., and then grab the commit message from the command line. I'm not sure if this is the exact syntax you need though, total guess.

https://help.github.com/en/actions/automating-your-workflow-with-github-actions/contexts-and-expression-syntax-for-github-actions#github-context

edit: here's someone asking about a similar problem and some solutions: https://github.community/t5/GitHub-Actions/Accessing-commit-message-in-pull-request-event/td-p/40856

The problem is, it only gets the SHA for the last commit, I found that this would bring the SHA for the range:
github.event.commits.*.sha
but when I tested for push event it only brought the last commit also, I'm curious to see if for pull_request event it will work.
https://developer.github.com/v3/activity/events/types/#pushevent

Copy link
Contributor

@dralley dralley left a comment

Choose a reason for hiding this comment

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

@fabricio-aguiar How about we split off the "remove Travis CI" stuff into a second PR, that we can make immediately after this one? Then we can know immediately whether the Github Actions integration works for commit checks with Pull Requests, and not break Travis until we know that it does?

@dralley
Copy link
Contributor

dralley commented Feb 3, 2020

Do you think it's worthwhile to separate out the commit validation "job" from the others? Since it runs quickly and is one of the most common things to fail a PR? It also only needs to happen once (no benefit in applying it to the matrix), and if the dev notices that if failed they probably don't even need to inspect the result to realize why it failed.

@fao89
Copy link
Member Author

fao89 commented Feb 3, 2020

Do you think it's worthwhile to separate out the commit validation "job" from the others? Since it runs quickly and is one of the most common things to fail a PR?

I believe so, so far what I noticed is: travis seems like monolith and gh actions seems like microservices. I believe if we migrate to gh actions, in the future we will break many things into smaller pieces of code

@fao89
Copy link
Member Author

fao89 commented Feb 4, 2020

Copy link
Member

@mikedep333 mikedep333 left a comment

Choose a reason for hiding this comment

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

Other than the name of the 1 step, LGTM!

- name: Set tox env for python 37
if: matrix.python == '3.7'
run: echo "::set-env name=TOXENV::py37-${{ matrix.env.TEST_TYPE }}"
- name: Building images for upgrade
Copy link
Member

Choose a reason for hiding this comment

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

We're pulling them rather than building them.

Copy link
Member

@bmbouter bmbouter left a comment

Choose a reason for hiding this comment

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

This looks good. Let's give it a try! 🚀

@fao89 fao89 merged commit 8b0fcaa into pulp:master Feb 17, 2020
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.

None yet

4 participants