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

CI/CD: Github actions #2656

Open
wants to merge 2 commits into
base: master
from

Conversation

@bastimeyer
Copy link
Member

commented Oct 6, 2019

Why

We're currently using two CI providers, Appveyor for running tests on Windows and TravisCI for everything else. While Appveyor has caused issues in the past and is usually much slower than TravisCI, TravisCI's Windows VMs are still in beta with lack of support for secret env vars. See my previous PR #2342.

Github now supports CI/CD workflows via Github actions on Linux, Windows and macOS, which allows us to have all CI tasks being run in one place with direct integration into Github. This is all still beta though and I've already run into some issues while writing the initial config(s).

This is the first time I'm using Github actions and I haven't tested it in a private repo yet. The PR is therefore merely just a config suggestion for now. WIP

Docs can be found here:
https://help.github.com/en/categories/automating-your-workflow-with-github-actions

Checklist

  • Test all this in a secondary repo
    Needs a temp repo in the streamlink orga, as the Github actions beta is invite only.
  • Add "Test" job
    • Run tests in parallel on Ubuntu, Windows and macOS, using Python 2.7 and 3.5..3.8-dev
      • Don't fail early
        We want to see the results of all jobs
      • Allow failures in Python 3.8-dev environments
      • Report code coverage
        UNTESTED
        CODECOV_TOKEN env var needs to be set explititly for now (and possibly also the git branch name via --branch).
        See https://community.codecov.io/t//491
        • Add secret env vars to repo settings
    • Build docs in parallel on Ubuntu
    • Build Windows installer in parallel on Ubuntu
  • Add "Release" job (on tag)
    • Add secret env vars to repo settings
    • Deploy to PyPI
      • Split sdist/wheel script into build and deploy script
        UNTESTED
    • Deploy to Github releases
      • Cache Windows installer artifact
        PSEUDO CONFIG
        Building the installer twice is bad, but artifacts are limited by their configutation and the file size.
      • Rewrite Github releases helper script
        UNTESTED
        • Create or update release
        • Upload assets
        • Read Github's env vars
        • Move release template text into its own file
  • Add "Deploy documentation" job
    Doctr is written with TravisCI in mind. Needs some extra work.
    • Add secret env vars to repo settings
    • "Latest" (on push to master)
    • "Stable" (on tag push)
  • Add scheduled "Windows installer nightly build" job
    • Add secret env vars to repo settings
    • Cache Windows installer artifact
      Building the installer twice is bad, but artifacts are limited by their configutation and the file size.
    • Rewrite deploy config
      Maybe this can help:
      https://jfrog.com/blog/using-the-jfrog-cli-with-github-actions/
      Using artifacts instead of Bintray could be a solution, but there's no REST API available for getting the download URL, so users would need to browse the workflow results.

Issues / concerns

  • Since workflows can't be chained, everything has to be put into a large single config with nested conditional jobs or written in multiple workflows with lots of duplicate configs.
  • How fast is it? We won't gain much if the performance is terrible. The concurrent job limitation should be OK though.
  • Storing build artifacts between jobs is solved quite badly
  • Relying on 3rd party actions is bad

Notes

This would currently break the TravisCI config due to the rewrite of the release scripts (changes in .travis.yml required).

@codecov

This comment has been minimized.

Copy link

commented Oct 6, 2019

Codecov Report

Merging #2656 into master will decrease coverage by 1.07%.
The diff coverage is n/a.

@@            Coverage Diff             @@
##           master    #2656      +/-   ##
==========================================
- Coverage   52.73%   51.65%   -1.08%     
==========================================
  Files         243      243              
  Lines       15160    14823     -337     
==========================================
- Hits         7994     7657     -337     
  Misses       7166     7166
@bastimeyer bastimeyer force-pushed the bastimeyer:ci/github/init branch from d438bc5 to d282efa Oct 12, 2019
@codecov

This comment has been minimized.

Copy link

commented Oct 12, 2019

Codecov Report

Merging #2656 into master will not change coverage.
The diff coverage is n/a.

@@           Coverage Diff           @@
##           master    #2656   +/-   ##
=======================================
  Coverage   52.73%   52.73%           
=======================================
  Files         243      243           
  Lines       15160    15160           
=======================================
  Hits         7994     7994           
  Misses       7166     7166
@bastimeyer bastimeyer force-pushed the bastimeyer:ci/github/init branch from d282efa to ba0fbec Oct 12, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
1 participant
You can’t perform that action at this time.