-
Notifications
You must be signed in to change notification settings - Fork 45
GitHub Actions
Here some notes on GitHub actions and how they are used in GlideinWMS.
GitHub can run Workflows that are composed of jobs which are a sequence of steps. Jobs are run independently on different runners (VMs); orchestration and service execution are possible. Each step is a process that executes some commands or one action, in the current runner or in a container (user-defined).
GitHub runs actions (Workflows) on VM based on the Ubuntu, Mac, or Windows OSes: https://docs.github.com/en/free-pro-team@latest/actions/reference/specifications-for-github-hosted-runners
Artifacts and caches can be used to pass data between jobs and different executions: https://github.com/actions/toolkit/tree/main/packages https://github.com/actions/download-artifact
act is a tool to run the actions locally.
There 2 difficult steps to getting act going:
- a bug where it is not finding the correct version of code/actions: https://github.com/nektos/act/pull/433 https://github.com/nektos/act/issues/311
- picking the docker image to use for the runner, something close to the one used by GitHub, with all the needed software installed and that can run the actions. The act provided one is not working (it does not have even git installed.
Here are workflow commands (set output, environment, ...) needed because steps are in different processes.
To use the REST API (e.g. from the browser, or curl so you can authenticate) and set a token:
- https://docs.github.com/en/free-pro-team@latest/rest/guides/getting-started-with-the-rest-api
- https://github.com/settings/tokens
- GitHub CLI will ease setup and renewal of tokens
Other links:
- CI examples (for Javascript):
- Here to build and test Python, with some interesting examples, including a code matrix (run on multiple versions of Python 3):
- interesting actions:
- GitHub actions advent calendar (good resource to learn about actions)