Skip to content
This repository has been archived by the owner on Nov 1, 2022. It is now read-only.

ci: Migrate tests to GitHub actions #2940

Merged
merged 5 commits into from
Mar 30, 2020
Merged

ci: Migrate tests to GitHub actions #2940

merged 5 commits into from
Mar 30, 2020

Conversation

stefanprodan
Copy link
Member

@stefanprodan stefanprodan commented Mar 26, 2020

GitHub Actions migration (ref: #2944):

  • run unit tests
  • verify codegen
  • build binaries and containers
  • run e2e tests (four Kubernetes Kind clusters matrix)

GH Actions specific changes:

  • cache go modules
  • run one Kubernetes cluster per VM
  • upload fluxd container image, fluxctl, kubectl, kustomize and sops to GH artifacts
  • download the artifacts in e2e jobs to avoid rebuilding binaries and containers
  • cleanup artifacts daily

Conclusions:

  • the random kind/docker/kubeadm failures that we experienced with CircleCI are gone
  • no more sudo killall apt-get, apt-get doesn't hang like in CircleCI
  • the e2e tests take the same amount of time on GH Actions free as in CircleCI paid account
  • the major downside to GH Actions is the lack of docker image caching between jobs
  • you have to use docker save/load and upload/download artifacts between jobs
  • you can't delete artifacts during a GH workflow run
  • GH Actions UI is unreliable and buggy, most of the time the logs are not displayed until the job finishes

Overall I'm happy with GitHub Actions even though it was a painful migration.

@stefanprodan stefanprodan force-pushed the ci-github-actions branch 9 times, most recently from 82776db to 5664652 Compare March 26, 2020 16:21
@stefanprodan stefanprodan changed the title WIP: Migrate CI to GitHub actions WIP: Migrate e2e tests to GitHub actions Mar 26, 2020
@stefanprodan stefanprodan changed the title WIP: Migrate e2e tests to GitHub actions WIP: Migrate tests to GitHub actions Mar 26, 2020
@stefanprodan stefanprodan changed the title WIP: Migrate tests to GitHub actions ci: Migrate tests to GitHub actions Mar 26, 2020
@stefanprodan stefanprodan requested a review from hiddeco March 26, 2020 18:27
@stefanprodan stefanprodan force-pushed the ci-github-actions branch 9 times, most recently from 0bcc67a to 8f5f919 Compare March 27, 2020 13:42
@stefanprodan stefanprodan mentioned this pull request Mar 27, 2020
9 tasks
@stefanprodan stefanprodan added the build About the build or test scaffolding label Mar 27, 2020
.circleci/config.yml Outdated Show resolved Hide resolved
@dholbach
Copy link
Member

Well done @stefanprodan - you got this done in next to no time!

- use 4 Kubernetes Kind cluster for e2e tests
- store Flux container image and cache dir in artifacts
- download artifacts in e2e jobs to avoid rebuilding binaries and containers
- cleanup artifacts daily
needs: unit-testing
strategy:
matrix:
test: ['10_* 11_* 12_*', '13_* 14_*', '15_* 16_* 17_*', '20_* 21_* 22_*']
Copy link
Member

Choose a reason for hiding this comment

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

Would something like

        test: ['1/4', '2/4', '3/4', '4/4']

be an option (with additional logic added to run-gh.bash)? This would make (newly) added tests run without (forgetting) to add them here.

Copy link
Member Author

Choose a reason for hiding this comment

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

I've balanced the tests to take the same amount of time, for example running 15 in shard 2 will take 18m

Copy link
Member

Choose a reason for hiding this comment

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

Ack.

Copy link
Member Author

Choose a reason for hiding this comment

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

I think we should refactor the tests and have the balancing logic in bash, but this can come later.

@stefanprodan stefanprodan merged commit fae1d81 into master Mar 30, 2020
@stefanprodan stefanprodan deleted the ci-github-actions branch March 30, 2020 08:43
@dholbach dholbach added this to the 1.19.0 milestone Apr 1, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
build About the build or test scaffolding
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants