Skip to content
This repository has been archived by the owner on Apr 25, 2023. It is now read-only.

build: Switch to Github Actions from Travis #1420

Conversation

jimmidyson
Copy link
Contributor

What this PR does / why we need it:

This PR switches from Travis to Github Actions for PR builds - travis-ci.org is shutting down and migrating to travis-ci.com is equivalent effort to switching to Github Actions, which supposedly members have had a better experience with.

Which issue(s) this PR fixes
Fixes #1419

Special notes for your reviewer:
Need to test this PR somehow - hope that pushing it triggers Github Actions.

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Jun 8, 2021
@k8s-ci-robot k8s-ci-robot added approved Indicates a PR has been approved by an approver from all required OWNERS files. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Jun 8, 2021
Comment on lines -37 to -38
after_success:
- test $DOC_ONLY && echo "Skipped!" || make push
Copy link
Contributor

Choose a reason for hiding this comment

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

This path isn't reflect in the GitHub Actions workflow above. Given the Makefile reads the TRAVIS_PULL_REQUEST environment variable in the push target, I take it we need to rework that a bit. My preference would be to just push anytime the target is called and only call that on: push.tags. wdyt?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done in 77a49de (i hope!)

@@ -0,0 +1,25 @@
name: PR build

on: [pull_request]
Copy link
Contributor

Choose a reason for hiding this comment

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

This might pose a problem as GitHub Actions workflows triggered from forks do not have access to secrets: https://github.blog/2020-08-03-github-actions-improvements-for-fork-and-pull-request-workflows/#improvements-for-public-repository-forks
Solution:

Suggested change
on: [pull_request]
on: [pull_request_target]

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 don't think this will work because this runs in the context of the base branch - it's only used for labelling, commenting, etc. not running code from an untrusted fork.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

pull_request_target doesn't use the pull request code though from what i've read, so it doesn't open up security issues. i'm hoping that github actions run on servers that have no pull rate limiting 🤞

Copy link
Contributor Author

Choose a reason for hiding this comment

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

actions/runner-images#1445 explains that GitHub actions have no pull limit (agreement with docker hub) so no need to login.

@k8s-ci-robot k8s-ci-robot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Jun 8, 2021
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: jimmidyson, makkes

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@makkes
Copy link
Contributor

makkes commented Jun 8, 2021

/lgtm

I believe there's no other way than to try it out. 🙂

@k8s-ci-robot k8s-ci-robot added the lgtm Indicates that a PR is ready to be merged. label Jun 8, 2021
@k8s-ci-robot k8s-ci-robot merged commit 5c079c5 into kubernetes-retired:master Jun 8, 2021
@hectorj2f hectorj2f deleted the github-actions-replace-travis branch June 8, 2021 21:41
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm Indicates that a PR is ready to be merged. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Migrate from travis-ci.org to travis-ci.com
3 participants