|
| 1 | +# GitHub Actions Workflows |
| 2 | + |
| 3 | +## Setup |
| 4 | +- workloads run using [GitHub self-hosted runners](https://help.github.com/en/actions/automating-your-workflow-with-github-actions/about-self-hosted-runners) |
| 5 | +- project admins maintain a private Google Compute Engine VM for running tests |
| 6 | + - VM should be at least n1-standard-4 with 50GB persistent disk |
| 7 | + - instructions for setting up the VM can be found in repo settings under "Actions" |
| 8 | + - ⚠️ WARNING: VM should be set up with no GCP service account |
| 9 | + - external contributors could contribute malicious PRs to run code on our test VM. Ensure no service accounts or other secrets exist on the VM |
| 10 | + - An empty GCP project should be used for extra security |
| 11 | + - to set up dependencies, run the following commands: |
| 12 | + ``` |
| 13 | + # install kubectl |
| 14 | + sudo apt-get install kubectl |
| 15 | +
|
| 16 | + # install kind |
| 17 | + curl -Lo ./kind "https://github.com/kubernetes-sigs/kind/releases/download/v0.7.0/kind-$(uname)-amd64" && \ |
| 18 | + chmod +x ./kind && \ |
| 19 | + sudo mv ./kind /usr/local/bin |
| 20 | +
|
| 21 | + # install skaffold |
| 22 | + curl -Lo skaffold https://storage.googleapis.com/skaffold/releases/latest/skaffold-linux-amd64 && \ |
| 23 | + chmod +x skaffold && \ |
| 24 | + sudo mv skaffold /usr/local/bin |
| 25 | +
|
| 26 | + # install docker |
| 27 | + sudo apt install apt-transport-https ca-certificates curl gnupg2 software-properties-common && \ |
| 28 | + curl -fsSL https://download.docker.com/linux/debian/gpg | sudo apt-key add - && \ |
| 29 | + sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/debian $(lsb_release -cs) stable" && \ |
| 30 | + sudo apt update && \ |
| 31 | + sudo apt install docker-ce && \ |
| 32 | + sudo usermod -aG docker ${USER} |
| 33 | +
|
| 34 | + # logout and back on |
| 35 | + exit |
| 36 | + ``` |
| 37 | + - ensure GitHub Actions runs as background service: |
| 38 | + ``` |
| 39 | + sudo ∼/actions-runner/svc.sh install |
| 40 | + sudo ∼/actions-runner/svc.sh start |
| 41 | + ``` |
| 42 | +
|
| 43 | +
|
| 44 | +--- |
| 45 | +## Workflows |
| 46 | +
|
| 47 | +### ci.yaml |
| 48 | +
|
| 49 | +#### Triggers |
| 50 | +- commits pushed to master |
| 51 | +- PRs to master |
| 52 | +- PRs to release/ branches |
| 53 | +
|
| 54 | +#### Actions |
| 55 | +- ensures kind cluster is running |
| 56 | +- builds all containers in src/ |
| 57 | +- deploys local containers to kind |
| 58 | + - ensures all pods reach ready state |
| 59 | + - ensures HTTP request to frontend returns HTTP status 200 |
| 60 | +- deploys manifests from /releases |
| 61 | + - ensures all pods reach ready state |
| 62 | + - ensures HTTP request to frontend returns HTTP status 200 |
0 commit comments