Skip to content

Commit

Permalink
fix: completely remove any native runner reference
Browse files Browse the repository at this point in the history
  • Loading branch information
alessandro-mariotti-zupit committed Apr 16, 2024
1 parent d47a3bc commit 0e43030
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 37 deletions.
4 changes: 0 additions & 4 deletions .github/workflows/django-step-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,6 @@ on:
required: false
type: string
default: 'Container'
RUNNERS_NATIVE_GROUP:
required: false
type: string
default: 'Native'
WORKING_DIRECTORY:
required: true
type: string
Expand Down
4 changes: 0 additions & 4 deletions .github/workflows/node-step-docker-build-and-push-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,6 @@ on:
required: false
type: string
default: 'Container'
RUNNERS_NATIVE_GROUP:
required: false
type: string
default: 'Native'
DIND_IMAGE:
required: false
type: string
Expand Down
4 changes: 0 additions & 4 deletions .github/workflows/node-workflow-common.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,6 @@ on:
required: false
type: string
default: 'Container'
RUNNERS_NATIVE_GROUP:
required: false
type: string
default: 'Native'
RUN:
required: false
type: boolean
Expand Down
28 changes: 5 additions & 23 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -849,10 +849,6 @@ In all the examples, we set _secrets: inherit_ to pass all secrets to the reusab
In addition, we added for all _step_ workflows the input _LABELS_ as GitHub does not allow to set the _runs-on_ from the caller side, but only inside
the reusable workflows. As we want to define the runners as late as possible, we decided to add this input variable.

In the _workflow_ type, you will note that we defined 2 inputs for the labels: NATIVE_LABELS and CONTAINER_LABELS.
We had to differentiate as GitHub runners might start to raise permissions errors due to Docker being run as root.
To fix this problem, workflows using docker images must use different runners from workflows running commands directly on the host.

### Naming convention

We've defined 2 different types of workflows:
Expand Down Expand Up @@ -919,7 +915,6 @@ In addition, it is possible to specify these optional inputs:
- **PROJECT**: The project to use when running npm scripts. If set, the executed npm script will be `{PROJECT}:{SCRIPT_NAME}` instead of `{SCRIPT_NAME}`.
- **RUN_ON**: the _label_ to select the correct _github-runner_ that will execute this workflow. Default is **zupit-agents**.
- **RUNNERS_CONTAINER_GROUP**: The runners group used to execute this workflow. Default is **Container**.
- **RUNNERS_NATIVE_GROUP**: The runners group used to execute this workflow. Default is **Native**.

This is an example to show how data should be formatted.

Expand All @@ -944,7 +939,7 @@ Here is an example of how to know if the code changed and based from that, run o
```yaml
jobs:
check-changes:
runs-on: [pinga, pipeline, native]
runs-on: [pinga, pipeline, container]
outputs:
backend: ${{ steps.changes.outputs.backend }}
Expand All @@ -966,8 +961,6 @@ jobs:
with:
WORKING_DIRECTORY: "frontend"
NODE_VERSION: "14.11.0"
NATIVE_CI_LABELS: "['pinga', 'pipeline', 'native']"
CONTAINER_CI_LABELS: "['pinga', 'pipeline', 'container']"
ENABLE_TESTS: false
RUN: ${{ needs.check-changes.outputs.frontend == 'true' }}
secrets: inherit
Expand Down Expand Up @@ -1114,7 +1107,6 @@ In addition, it is possible to specify this optional input:

- **RUN_ON**: the _label_ to select the correct _github-runner_ that will execute this workflow. Default is **zupit-agents**.
- **RUNNERS_CONTAINER_GROUP**: The runners group used to execute this workflow. Default is **Container**.
- **RUNNERS_NATIVE_GROUP**: The runners group used to execute this workflow. Default is **Native**.
- **COVERAGE_ARTIFACT_NAME**: The artifact's name for the _coverage-django.xml_ file. By default, it is **coverage-django.xml**.
- **RUN**: Whether to run all the inside workflows or not. This is useful when you want to skip checks since the code didn't change. By default, it is **true**.
- **DJANGO_MIGRATIONS_CHECK_APPS**: The Django apps on which to run migration checks.
Expand Down Expand Up @@ -1147,7 +1139,7 @@ Here is an example of how to know if the code changed and based from that, run o
```yaml
jobs:
check-changes:
runs-on: [pinga, pipeline, native]
runs-on: [pinga, pipeline, container]
outputs:
backend: ${{ steps.changes.outputs.backend }}
Expand All @@ -1169,8 +1161,6 @@ jobs:
with:
WORKING_DIRECTORY: "backend"
PYTHON_IMAGE: "python:3.8.2-slim-buster"
NATIVE_CI_LABELS: "['pinga', 'pipeline', 'native']"
CONTAINER_CI_LABELS: "['pinga', 'pipeline', 'container']"
RUN: ${{ needs.check-changes.outputs.backend == 'true' }}
secrets: inherit
```
Expand Down Expand Up @@ -1216,10 +1206,6 @@ In addition, it is possible to specify this optional input:
required: false
type: string
default: 'zupit-agents'
RUNNERS_NATIVE_GROUP:
required: false
type: string
default: 'Native'
RUNNERS_CONTAINER_GROUP:
required: false
type: string
Expand All @@ -1229,7 +1215,6 @@ In addition, it is possible to specify this optional input:
- **RUN**: Whether to run all the inside workflows or not. This is useful when you want to skip checks since the code didn't change. By default, it is **true**.
- **RUN_ON**: the _label_ to select the correct _github-runner_ that will execute this workflow. Default is **zupit-agents**.
- **RUNNERS_CONTAINER_GROUP**: The runners group used to execute this workflow. Default is **Container**.
- **RUNNERS_NATIVE_GROUP**: The runners group used to execute this workflow. Default is **Native**.

This is an example to show how data should be formatted.

Expand All @@ -1254,7 +1239,7 @@ Here is an example of how to know if the code changed and based from that, run o
```yaml
jobs:
check-changes:
runs-on: [pinga, pipeline, native]
runs-on: [pinga, pipeline, containers]
outputs:
backend: ${{ steps.changes.outputs.backend }}
Expand All @@ -1273,7 +1258,6 @@ jobs:
java-common:
uses: zupit-it/pipeline-templates/.github/workflows/[email protected]
with:
NATIVE_CI_LABELS: "['pinga', 'pipeline', 'native']"
CONTAINER_CI_LABELS: "['pinga', 'pipeline', 'container']"
WORKING_DIRECTORY: backend
JAVA_IMAGE: openjdk:12
Expand Down Expand Up @@ -1419,7 +1403,7 @@ It requires these inputs:
In addition, it is possible to specify these optional inputs:

- **RUN_ON**: the _label_ to select the correct _github-runner_ that will execute this workflow. Default is **zupit-agents**.
- **RUNNERS_NATIVE_GROUP**: The runners group used to execute this workflow. Default is **Native**.
- **RUNNERS_CONTAINER_GROUP**: The runners group used to execute this workflow. Default is **Container**.
- **REGISTRY_URL**: The registry url where to push the Docker image. By default, it is **ghcr.io**.
- **REGISTRY_USER**: The registry url where to push the Docker image.
By default, it is the GitHub variable **github.actor**, the user who started the workflow. If you need a different user, remember to override the **GITHUB_TOKEN** secret.
Expand Down Expand Up @@ -1473,7 +1457,7 @@ It requires these inputs:

In addition, it is possible to specify this optional input:

- **RUNNERS_NATIVE_GROUP**: The runners group used to execute this workflow. Default is **Native**.
- **RUNNERS_CONTAINER_GROUP**: The runners group used to execute this workflow. Default is **Container**.


This is an example to show how data should be formatted.
Expand Down Expand Up @@ -1603,7 +1587,6 @@ jobs:
jira-move-issue-to-in-progress:
uses: zupit-it/pipeline-templates/.github/workflows/[email protected]
with:
LABELS: "['pinga', 'pipeline', 'native']"
STATUS: "In progress"
BRANCH_OR_COMMIT_TITLE: ${{ github.head_ref }}
secrets: inherit
Expand All @@ -1625,7 +1608,6 @@ jobs:
if: ${{ !github.event.pull_request.draft }}
uses: zupit-it/pipeline-templates/.github/workflows/[email protected]
with:
LABELS: "['pinga', 'pipeline', 'native']"
STATUS: "Merge request"
BRANCH_OR_COMMIT_TITLE: ${{ github.head_ref }}
secrets: inherit
Expand Down
3 changes: 1 addition & 2 deletions docs/GROUPED_STEP_WORKFLOWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,8 @@ This is an example to show how data should be formatted.
jobs:
node-lint-check-build:
uses:
zupit-it/pipeline-templates/.github/workflows/node-step-format-lint-build.yml@v1.0.2
zupit-it/pipeline-templates/.github/workflows/node-step-format-lint-build.yml@v1.22.4
with:
LABELS: "['pinga', 'pipeline', 'native']"
WORKING_DIRECTORY: frontend
NODE_VERSION: 14.11.0
secrets: inherit
Expand Down

0 comments on commit 0e43030

Please sign in to comment.