Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

new(ci): added gha. #961

Merged
merged 8 commits into from
Feb 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 18 additions & 18 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,21 +44,21 @@ jobs:
./tools/deploy_prow.sh
workflows:
version: 2
build:
jobs:
- "test-infra/scan/terraform":
context: test-infra
- "test-infra/deploy/terraform":
requires:
- test-infra/scan/terraform
context: test-infra
filters:
branches:
only: master
- "test-infra/deploy/prow":
requires:
- test-infra/deploy/terraform
context: test-infra
filters:
branches:
only: master
# build:
# jobs:
# - "test-infra/scan/terraform":
# context: test-infra
# - "test-infra/deploy/terraform":
# requires:
# - test-infra/scan/terraform
# context: test-infra
# filters:
# branches:
# only: master
# - "test-infra/deploy/prow":
# requires:
# - test-infra/deploy/terraform
# context: test-infra
# filters:
# branches:
# only: master
47 changes: 47 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: CI

on:
pull_request:
branches: [master]

# Checks if any concurrent jobs under the same pull request or branch are being executed
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true

jobs:
manifests-validation:
runs-on: ubuntu-latest

steps:
- name: Checkout test-infra ⤵️
uses: actions/checkout@v4

- name: Setup Kubeval ⛓️
uses: lra/[email protected]

- name: yaml config validation 🔍
run: kubeval --directories config/prow --ignore-missing-schemas

scan-terraform:
runs-on: ubuntu-latest
steps:
- name: Checkout test-infra ⤵️
uses: actions/checkout@v4

- name: Setup Go
uses: actions/setup-go@v1
with:
go-version: 1.19

- name: Install deps
run: |
curl -L "$(curl -Ls https://api.github.com/repos/accurics/terrascan/releases/latest | grep -o -E "https://.+?_Linux_x86_64.tar.gz")" > terrascan.tar.gz
tar -xf terrascan.tar.gz
install terrascan /usr/local/bin

- name: Scan terrafrom code
run: |
terrascan scan -i terraform -d config/clusters -v \
--skip-rules 'AC_AWS_0214,AC_AWS_0369,AC_AWS_0487,AC_AWS_078,AWS.CloudTrail.Logging.Medium.007,AC_AWS_0447,AC_AWS_0497,AC_AWS_0458,AC_AWS_0320'

44 changes: 44 additions & 0 deletions .github/workflows/master.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: Master CI - deploys terraform and prow

on:
push:
branches: [master]

concurrency:
group: master-CI
cancel-in-progress: false

jobs:
deploy-terraform:
permissions:
id-token: write
contents: read
runs-on: ubuntu-22.04
steps:
- name: Checkout test-infra ⤵️
uses: actions/checkout@v4

- name: Configure AWS credentials 🔧⚙️
uses: aws-actions/configure-aws-credentials@v2
with:
role-to-assume: "arn:aws:iam::292999226676:role/github_actions-test-infra-cluster"
aws-region: eu-west-1

- name: Deploy terraform
run: |
./tools/deploy_terraform.sh
deploy-prow:
runs-on: ubuntu-22.04
needs: deploy-terraform
steps:
- name: Checkout test-infra ⤵️
uses: actions/checkout@v4

- name: Deploy prow
env:
PROW_HMAC_TOKEN: ${{ secrets.PROW_HMAC_TOKEN }}
PROW_OAUTH_TOKEN: ${{ secrets.PROW_OAUTH_TOKEN }}
PROW_SERVICE_ACCOUNT_JSON: ${{ secrets.PROW_SERVICE_ACCOUNT_JSON }}
run: |
./tools/deploy_prow.sh
20 changes: 0 additions & 20 deletions .github/workflows/validate_manifests.yml

This file was deleted.

Loading