From 266d2f1a52b6b99671fb3f57e6416f272cd4f262 Mon Sep 17 00:00:00 2001 From: Marvin Buss Date: Mon, 15 Jan 2024 20:17:20 +0100 Subject: [PATCH] Workflow Cosmetic Changes --- .github/workflows/_containerTemplate.yml | 6 +++--- .../workflows/_terraformEnvironmentTemplate.yml | 14 +++++++++----- .github/workflows/lint.yml | 14 ++++++++++---- .github/workflows/newMajorVersion.yml | 1 - .github/workflows/terraform.yml | 3 +++ 5 files changed, 25 insertions(+), 13 deletions(-) diff --git a/.github/workflows/_containerTemplate.yml b/.github/workflows/_containerTemplate.yml index 55133e1..2174ab3 100644 --- a/.github/workflows/_containerTemplate.yml +++ b/.github/workflows/_containerTemplate.yml @@ -37,7 +37,7 @@ on: jobs: deployment: name: Container Build & Push - runs-on: ubuntu-latest + runs-on: [ubuntu-latest] continue-on-error: false environment: ${{ inputs.environment }} @@ -54,8 +54,8 @@ jobs: # Install cosign - name: Install cosign - uses: sigstore/cosign-installer@v3.3.0 id: install_cosign + uses: sigstore/cosign-installer@v3.3.0 if: github.event_name != 'pull_request' with: cosign-release: 'v2.2.0' @@ -72,8 +72,8 @@ jobs: # Login Container Registry - name: Login Container Registry - uses: docker/login-action@v3.0.0 id: registry_login + uses: docker/login-action@v3.0.0 if: github.event_name != 'pull_request' with: registry: ${{ inputs.registry_uri }} diff --git a/.github/workflows/_terraformEnvironmentTemplate.yml b/.github/workflows/_terraformEnvironmentTemplate.yml index 493c955..ad7499d 100644 --- a/.github/workflows/_terraformEnvironmentTemplate.yml +++ b/.github/workflows/_terraformEnvironmentTemplate.yml @@ -15,6 +15,10 @@ on: required: true type: string description: "Specifies the terraform version." + node_version: + required: true + type: number + description: "Specifies the node version." working_directory: required: true type: string @@ -46,7 +50,7 @@ permissions: jobs: lint: name: Terraform Lint - runs-on: ubuntu-latest + runs-on: [ubuntu-latest] continue-on-error: false steps: @@ -92,7 +96,7 @@ jobs: plan: name: Terraform Plan - runs-on: self-hosted + runs-on: [self-hosted] continue-on-error: false environment: ${{ inputs.environment }} needs: [lint] @@ -110,7 +114,7 @@ jobs: id: node_setup uses: actions/setup-node@v4 with: - node-version: 18 + node-version: ${{ inputs.node_version }} # Setup Terraform - name: Setup Terraform @@ -186,7 +190,7 @@ jobs: apply: name: Terraform Apply - runs-on: self-hosted + runs-on: [self-hosted] continue-on-error: false environment: ${{ inputs.environment }} if: github.event_name == 'push' || github.event_name == 'release' @@ -205,7 +209,7 @@ jobs: id: node_setup uses: actions/setup-node@v4 with: - node-version: 18 + node-version: ${{ inputs.node_version }} # Setup Terraform - name: Setup Terraform diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 1719ddc..af15041 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -10,7 +10,8 @@ on: jobs: lint: name: Lint and Test - runs-on: ubuntu-latest + runs-on: [ubuntu-latest] + continue-on-error: false steps: # Setup Python 3.11 @@ -37,8 +38,13 @@ jobs: - name: Run Linting id: linting run: | - pip install -r requirements.txt -q + echo "Install dependencies" + python3 -m pip install -r requirements.txt -q + + echo "Initialize Git" git init git add * - pre-commit install --install-hooks - pre-commit run --all-files --verbose + + echo "Run pre-commit" + python3 -m pre_commit install --install-hooks + python3 -m pre_commit run --all-files --verbose diff --git a/.github/workflows/newMajorVersion.yml b/.github/workflows/newMajorVersion.yml index 608914e..348f573 100644 --- a/.github/workflows/newMajorVersion.yml +++ b/.github/workflows/newMajorVersion.yml @@ -15,7 +15,6 @@ permissions: env: TAG_NAME: ${{ github.event.inputs.tag_name || github.event.release.tag_name }} - jobs: update_tag: name: Update the major tag to include the ${{ github.event.inputs.tag_name || github.event.release.tag_name }} changes diff --git a/.github/workflows/terraform.yml b/.github/workflows/terraform.yml index 7224fef..ef428d6 100644 --- a/.github/workflows/terraform.yml +++ b/.github/workflows/terraform.yml @@ -6,6 +6,7 @@ on: paths: - "**.tf" - "code/infra/**" + - ".github/workflows/terraform.yml" pull_request: branches: @@ -13,6 +14,7 @@ on: paths: - "**.tf" - "code/infra/**" + - ".github/workflows/terraform.yml" jobs: terraform_dev: @@ -22,6 +24,7 @@ jobs: environment: "dev" config: "PerfectThymeTech" terraform_version: "1.6.6" + node_version: 18 working_directory: "./code/infra" tenant_id: "3556be79-2979-4b19-a1af-4dd4e6d9ed7e" subscription_id: "8f171ff9-2b5b-4f0f-aed5-7fa360a1d094"