team-compass icon indicating copy to clipboard operation
team-compass copied to clipboard

Travis migrations to GitHub actions

Open consideRatio opened this issue 4 years ago • 2 comments

With no reply from Travis still regarding #351, @manics @betatim and I have got started on some migrations.

Reference example

I have worked to provide relevant comments in the GitHub Workflow defined in https://github.com/jupyterhub/jupyterhub/pull/3246 to be of use as a reference example of how things work.

Tips

  • Python setup / Node setup: use the setup-python and setup-node actions, they run in less than a second because of a smart cache in the base environment.
  • SSH key setup: to setup a SSH key for pushes git repos etc or just secrets in general, see how it can be done here.
  • LANG env var: GitHub Workflow's aren't UTF-8 friendly by default, you may need to set it explicitly to C.UTF-8 sometimes.
    env:
      # UTF-8 content may be interpreted as ascii and causes errors without this.
      LANG: C.UTF-8
    
  • fail-fast: false: By setting jobs.<name>.strategy.fail-fast: false you avoid letting all variations of the job stop when one of them fail.
  • Job run with different parameterization: by using jobs.<name>.strategy.matrix you can let a single job definition run multiple times using permutation of variables, or just use a list of predefined sets of combinations to include using jobs.<name>.strategy.matrix.include.
  • if conditions: Both steps and jobs can have if conditions set on them. Example:
    steps:
      - name: Start a database server (${{ matrix.db }})
        if: ${{ matrix.db }}
    
  • PyPI releases: see https://github.com/jupyterhub/oauthenticator/pull/383
  • npm releases: see https://github.com/jupyterhub/configurable-http-proxy/issues/275
  • GitHub actions badge for README files: The Workflow name is case sensitive and is what its named within the file, not the file name itself, watch out! GitHub Workflow Status
    [![GitHub Workflow Status](https://img.shields.io/github/workflow/status/jupyterhub/chartpress/Test?logo=github)](https://github.com/jupyterhub/chartpress/actions)
    
  • Run workflow button: By setting on.workflow_dispatch you can get a button to manually run a workflow. image
  • Colors: GitHub Workflow's make git, pytest, etc not realize colors are supported, so we need to explicitly do git --no-pager diff --color and pytest --color=yes for example when using those commands. This all relates to this issue: https://github.com/actions/runner/issues/241, which wasn't an issue in Travis CI
  • edit and add more here

Repo migration overview

  • [x] https://github.com/jupyterhub/zero-to-jupyterhub-k8s/pull/1896 (Helm chart release)
  • [x] https://github.com/jupyterhub/jupyterhub/pull/3246
  • [x] https://github.com/jupyterhub/configurable-http-proxy/issues/275 (npm release)
  • [x] https://github.com/jupyterhub/binderhub/pull/1209 (PyPI release)
  • [x] https://github.com/jupyterhub/kubespawner/pull/459 (PyPI release)
  • [x] https://github.com/jupyterhub/oauthenticator/pull/383 (PyPI release)
  • [x] https://github.com/jupyterhub/chartpress/pull/101 (PyPI release)
  • [x] https://github.com/jupyterhub/traefik-proxy/pull/113 (PyPI release)
  • [x] https://github.com/jupyterhub/ltiauthenticator/pull/33 (PyPI release)
  • [x] https://github.com/jupyterhub/jupyter-server-proxy/pull/225 (PyPI release, npm release)
  • [x] https://github.com/jupyterhub/firstuseauthenticator/issues/35 (PyPI release)
  • [x] https://github.com/jupyterhub/dockerspawner/issues/397 (PyPI release)
  • [x] https://github.com/jupyterhub/ldapauthenticator (PyPI release)
  • [x] https://github.com/jupyterhub/nbgitpuller (PyPI release)
  • [x] https://github.com/jupyterhub/repo2docker (PyPI release)
  • [x] https://github.com/jupyterhub/batchspawner
  • [ ] https://github.com/jupyterhub/jupyter-rsession-proxy
  • [ ] https://github.com/jupyterhub/hubshare
  • [ ] https://github.com/jupyterhub/yarnspawner
  • [ ] https://github.com/jupyterhub/kerberosauthenticator
  • [x] (because its archived) https://github.com/jupyterhub/jupyterlab-hub

I've added a pypi_password secret for all pypi packages in this list as the jupyterhub-bot PyPI user except for the jupyterhub repo.

consideRatio avatar Nov 09 '20 07:11 consideRatio

image

GitHub actions provides seemingly unlimited parallell builds! Omg!

consideRatio avatar Nov 10 '20 03:11 consideRatio

@minrk can you add jupyterhub-bot on PyPI as a maintainer of dockerspawner https://pypi.org/project/dockerspawner/?

consideRatio avatar Nov 14 '20 20:11 consideRatio