Skip to content

ci: replace travis completely with github actions #4554

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 6 commits into from
Mar 3, 2021

Conversation

estroz
Copy link
Member

@estroz estroz commented Feb 18, 2021

Recreation of #4544.

Description of the change:

  • .github/workflows/deploy.yml: set up image builds andreleasing with github actions
  • Makefile,release/Makefile: remove multiarch image build targets, since all non-host arch builds can be done in action configs
  • *: remove Travis CI config from project and references in docs

Motivation for the change: for various reasons (cost, reliability, debuggability, visibility) Travis is no longer viable for the operator-sdk project. Github Actions, via docker buildx, can support cross-platform image builds, release automation, and is way more configurable/ergonomic.

This work is based off of https://github.com/joelanford/helm-operator/blob/7fe2dd3/.github/workflows/deploy.yml.

Closes #3984

/area testing

Checklist

If the pull request includes user-facing changes, extra documentation is required:

releasing with github actions

Makefile,release/Makefile: remove multiarch image build targets,
since all non-host arch builds can be done in action configs

Signed-off-by: Eric Stroczynski <[email protected]>
Signed-off-by: Eric Stroczynski <[email protected]>
@openshift-ci-robot openshift-ci-robot added the area/testing Issue related to testing the operator-sdk and subcomponents label Feb 18, 2021
@estroz estroz temporarily deployed to deploy February 18, 2021 23:48 Inactive
@estroz estroz temporarily deployed to deploy February 18, 2021 23:48 Inactive
@estroz estroz temporarily deployed to deploy February 18, 2021 23:48 Inactive
@estroz estroz temporarily deployed to deploy February 18, 2021 23:48 Inactive
@estroz estroz temporarily deployed to deploy February 18, 2021 23:48 Inactive
@estroz estroz temporarily deployed to deploy February 18, 2021 23:48 Inactive
@estroz
Copy link
Member Author

estroz commented Feb 18, 2021

For some reason GitHub Environments weren't injecting environment variable secrets into #4544. The steps requiring those variables are now gated by != pull_request, so PR's will pass. Perhaps they'll get injected when this workflow runs on a master commit.

@estroz
Copy link
Member Author

estroz commented Feb 19, 2021

/cc @joelanford @jmrodri

@joelanford
Copy link
Member

@estroz The secrets are only injected in builds that originate from this repo (e.g. push and tag builds). It would be a security concern if secrets were exposed to PRs because malicious users could submit PRs to harvest credentials, etc.

@estroz
Copy link
Member Author

estroz commented Feb 19, 2021

The secrets are only injected in builds that originate from this repo (e.g. push and tag builds)

Ah duh that makes sense. I tested this on my own fork so obviously it worked there 😅.

context: .
# s390x is not supported by the scorecard-test-kuttl base image.
platforms: linux/amd64,linux/arm64,linux/ppc64le${{ matrix.id != 'scorecard-test-kuttl' && ',linux/s390x' || '' }}
push: ${{ (github.event_name != 'pull_request' && (startsWith(github.ref, 'refs/tags/') || github.ref == 'refs/heads/master')) }}
Copy link
Member

Choose a reason for hiding this comment

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

Is it possible to use ${{ github.event.repository.default_branch }} everywhere we reference master in this file?

That way if we ever change the default branch, we don't have to remember to change it here.

@estroz
Copy link
Member Author

estroz commented Feb 19, 2021

Related: #4555

Signed-off-by: Eric Stroczynski <[email protected]>
@estroz estroz temporarily deployed to deploy February 19, 2021 02:19 Inactive
@estroz estroz temporarily deployed to deploy February 19, 2021 02:19 Inactive
@estroz estroz temporarily deployed to deploy February 19, 2021 02:19 Inactive
@estroz estroz temporarily deployed to deploy February 19, 2021 02:19 Inactive
@estroz estroz temporarily deployed to deploy February 19, 2021 02:19 Inactive
@estroz estroz temporarily deployed to deploy February 19, 2021 02:19 Inactive
@estroz estroz temporarily deployed to deploy February 19, 2021 03:13 Inactive
@estroz estroz temporarily deployed to deploy February 19, 2021 03:13 Inactive
@estroz estroz temporarily deployed to deploy February 19, 2021 03:13 Inactive
@estroz estroz temporarily deployed to deploy February 19, 2021 03:13 Inactive
@estroz estroz temporarily deployed to deploy February 19, 2021 03:13 Inactive
@estroz estroz temporarily deployed to deploy February 19, 2021 03:13 Inactive
Copy link
Member

@joelanford joelanford left a comment

Choose a reason for hiding this comment

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

/lgtm

@openshift-ci-robot openshift-ci-robot added the lgtm Indicates that a PR is ready to be merged. label Feb 20, 2021
@estroz estroz merged commit d940893 into operator-framework:master Mar 3, 2021
@estroz estroz deleted the feature/actions-releases branch March 3, 2021 20:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/testing Issue related to testing the operator-sdk and subcomponents lgtm Indicates that a PR is ready to be merged.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Use multi-stage Dockerfiles for all images
3 participants