Skip to content

Commit

Permalink
new(ci): added gha.
Browse files Browse the repository at this point in the history
Signed-off-by: Federico Di Pierro <[email protected]>
  • Loading branch information
FedeDP committed Jan 20, 2023
1 parent 9eb157e commit 66d5bd9
Show file tree
Hide file tree
Showing 2 changed files with 81 additions and 0 deletions.
52 changes: 52 additions & 0 deletions .github/workflows/postsubmit.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: PostSubmit

on:
push:
branches:
- master

jobs:
deploy-terraform:
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0

- id: install-aws-cli
uses: unfor19/install-aws-cli-action@v1
with:
arch: amd64

- name: Install deps ⛓️
run: |
apt update && apt install -j jq unzip git
- name: Deploy terraform
run: |
./tools/deploy_terraform.sh
deploy-prow:
runs-on: ubuntu-22.04
needs: deploy-terraform
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0

- id: install-aws-cli
uses: unfor19/install-aws-cli-action@v1
with:
arch: amd64

- name: Install deps ⛓️
run: |
apt update && apt install -j jq unzip git wget curl which
wget "https://storage.googleapis.com/kubernetes-release/release/$(curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt)/bin/linux/amd64/kubectl" -O /usr/local/bin/kubectl
chmod +x /usr/local/bin/kubectl
- name: Deploy prow
run: |
./tools/deploy_prow.sh
29 changes: 29 additions & 0 deletions .github/workflows/presubmit.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: PreSubmit
on:
pull_request:

jobs:
scan-terraform:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0

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

- name: Install deps
run: |
apt update && apt install curl tar
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'

0 comments on commit 66d5bd9

Please sign in to comment.