-
-
Notifications
You must be signed in to change notification settings - Fork 345
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
Move Travis CI to GitHub Workflows #3085
Conversation
Well, I ❤️ this. Where are our build experts to approve it? |
I think this is brilliant! I can sort out the dockerhub username/password. We might want to move the KEY_ID and Dockerhub Username into Secrets for convenience and ease of updating if required. For S3, we'll need to regenerate the creds. So probably makes sense to add this into our stack with explicit permissions and then revoke the old ones. I'll be able to do this over the next day or 2, just need to collect up the paths they have access to. |
I've configured all the secrets. So uploading to Dockerhub will work and the redeploy wil work. The real rub is that the S3 link isn't a part of KSP-CKANs AWS tenancy, it's @pjf 's private one from memory. We should consider what we want to do there. http://ckan-travis.s3-website-us-east-1.amazonaws.com/ As far as the project is concerned, it is mainly used by the metadata CI and giving out test builds. We can give the builder creds access to a bucket in our tenancy and use that or convert to using GitHubs artifacts. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This all seems reasonable to me from my skim. I'm yet to use github actions personally, but we can always tweak things as needed.
Oh shoot, that was the old branch, DasSkelett/gh-workflow instead of upstream/gh-workflow. I hope this can be fixed... |
Replacement of #2994, re-pushed to a branch directly in the KSP-CKAN/CKAN repo to be able to test the workflows with this PR.
Motivation
While Travis is a great tool, it has its difficult times. Currently almost every CI run fails in one instance because of some network problems.
We already discussed this in the Discord a bit, and I think no one was really bound to Travis and the move to GitHub Workflows was generally supported.
Changes
This PR removes the .travis.yml file from the repository, so Travis is no longer triggered on merges.
Instead, there are now three workflow files according to the documentation:
The standard build workflow.
opened
,synchronize
andreopened
events. This is adjustable.build
andbuild_NetCore
.build
job:The
build
job contains a matrix: a list of Mono versions to use and a list of build configurations. It does one pass for each possibleconfiguration
+mono
combination (just like Travis did).The mono versions in the list are
5.20
,6.4
,6.6
and6.8
. So I removed5.16
and6.0
and added6.8
again compared to our current Travis config. I'm happy to change the versions, this was basically just what I filled in to have something for this workflow.It first removes the preinstalled Mono version (currently 6.4 on Ubuntu 18.04 workers, see this page)
Then it adds the Mono repository for the Mono version of this pass, and installs
mono-complete
. This step, as on Travis, takes the longest (~10 minutes). Unfortunately apt packages are not cacheable.Then it installs
libcurl4-openssl-dev
andxvfb
.Afterwards it tries to restore two caches for NuGet packages I've set up. They are keyed with the hash of the
packages.config
and all.csproj
files, so every change to those files (potentially changing our dependencies) invalidates them. In this case the packages are just downloaded as usual before build.The it's build time! Same command as before, nothing's changed there.
The
./build test+only
command has axvfb-run
prefixed, this is needed because I couldn't get xvfb to run as a service as it did in Travis. But I don't think that's a problem.If anything failed before, we get a nice message in the Discord. Note: This runs for PRs! So yes, we will get notifications for CI fails in PRs. This is easily changeable if it's too spammy.
build_NetCore
job:dotnet
. But the configuration matrix is there and containsDebug_NetCore
andRelease_NetCore
.3.1.1
(runtime) /3.1.101
(SDK).The deploy workflow
--delete
option:I couldn't really test this workflow, because it needs secrets set for the Docker Hub, to redeploy our Infra services and for the S3.
The release workflow:
upload_url
andtag_name
(i.e. the CKAN version)upload-release-asset
action for every single file we want to upload...It uploads the
ckan.exe
,AutoUpdater.exe
,ckan_*.deb
,CKAN.dmg
andckan-*.rpm
.If you want to see the log output of a
release
run after creating a new CKAN release: https://github.com/DasSkelett/CKAN/runs/428138462?check_suite_focus=trueSecrets
We (as in someone with admin right in this repository) need to set some secrets for this to work:
DISCORD_WEBHOOK
(pinging @Olympic1)DOCKERHUB_PASSWORD
(pinging @techman83)DOCKERHUB_USERNAME
maybe? Was not a secret in Travis, but could make sense.AWS_SECRET_ACCESS_KEY
(pinging @techman83)AWS_ACCESS_KEY_ID
maybe? Was not a secret in Travis, but could make sense.Future additions
We can extend this more in the future if we want.
It's really easy to upload artifacts to GitHub during workflows. This could replace the S3 (or exist alongside) and we would have the artifacts more accessible here in the repository. We could upload an artifact during the deploy workflow (the one that is run after merges/pushes to master).
They are also downloadable via the API: https://developer.github.com/v3/actions/artifacts/