From 0e43030b2d834fd90d871bd26031104b1e07a8a0 Mon Sep 17 00:00:00 2001 From: Alessandro Mariotti Date: Tue, 16 Apr 2024 13:51:07 +0200 Subject: [PATCH] fix: completely remove any native runner reference --- .github/workflows/django-step-tests.yml | 4 --- .../node-step-docker-build-and-push-image.yml | 4 --- .github/workflows/node-workflow-common.yml | 4 --- README.md | 28 ++++--------------- docs/GROUPED_STEP_WORKFLOWS.md | 3 +- 5 files changed, 6 insertions(+), 37 deletions(-) diff --git a/.github/workflows/django-step-tests.yml b/.github/workflows/django-step-tests.yml index 57a17784..a04995d1 100644 --- a/.github/workflows/django-step-tests.yml +++ b/.github/workflows/django-step-tests.yml @@ -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 diff --git a/.github/workflows/node-step-docker-build-and-push-image.yml b/.github/workflows/node-step-docker-build-and-push-image.yml index fc979147..f76fed2f 100644 --- a/.github/workflows/node-step-docker-build-and-push-image.yml +++ b/.github/workflows/node-step-docker-build-and-push-image.yml @@ -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 diff --git a/.github/workflows/node-workflow-common.yml b/.github/workflows/node-workflow-common.yml index 3265c49f..9941f76a 100644 --- a/.github/workflows/node-workflow-common.yml +++ b/.github/workflows/node-workflow-common.yml @@ -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 diff --git a/README.md b/README.md index 9a322c7b..f9278b55 100644 --- a/README.md +++ b/README.md @@ -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: @@ -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. @@ -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 }} @@ -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 @@ -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. @@ -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 }} @@ -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 ``` @@ -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 @@ -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. @@ -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 }} @@ -1273,7 +1258,6 @@ jobs: java-common: uses: zupit-it/pipeline-templates/.github/workflows/springboot-workflow-common.yml@v1.22.4 with: - NATIVE_CI_LABELS: "['pinga', 'pipeline', 'native']" CONTAINER_CI_LABELS: "['pinga', 'pipeline', 'container']" WORKING_DIRECTORY: backend JAVA_IMAGE: openjdk:12 @@ -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. @@ -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. @@ -1603,7 +1587,6 @@ jobs: jira-move-issue-to-in-progress: uses: zupit-it/pipeline-templates/.github/workflows/jira-step-move-issue.yml@v1.22.4 with: - LABELS: "['pinga', 'pipeline', 'native']" STATUS: "In progress" BRANCH_OR_COMMIT_TITLE: ${{ github.head_ref }} secrets: inherit @@ -1625,7 +1608,6 @@ jobs: if: ${{ !github.event.pull_request.draft }} uses: zupit-it/pipeline-templates/.github/workflows/jira-step-move-issue.yml@v1.22.4 with: - LABELS: "['pinga', 'pipeline', 'native']" STATUS: "Merge request" BRANCH_OR_COMMIT_TITLE: ${{ github.head_ref }} secrets: inherit diff --git a/docs/GROUPED_STEP_WORKFLOWS.md b/docs/GROUPED_STEP_WORKFLOWS.md index 2aa493a7..b4e4dd76 100644 --- a/docs/GROUPED_STEP_WORKFLOWS.md +++ b/docs/GROUPED_STEP_WORKFLOWS.md @@ -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