Skip to content
This repository has been archived by the owner on Mar 1, 2023. It is now read-only.

Commit

Permalink
First Merge with Pipeline (#14)
Browse files Browse the repository at this point in the history
* fix nested components

* Ci pipeline (#11)

* testing github actions

* adding build dir

* testing linting

* make ansible-lint strict

* fix logic for ansible lint for strict enforcement

* fixed linting

* unit testing

* unit testing

* unit testing

* testing unit test

* testing unit test

* testing unit test

* testing unit test

* testing

* testing

* testing

* testing

* testing

* testing

* only run on file changes

* only run on file changes

* testing

* test

* test

* test

* test

* test

* test

* test

* test

* test

* test

* test

* test

* testing

* testing

* ignore security distribution in unit test

* final push

* fixed pathing for istio/vault

* added stub e2e workflows

* added v7wk8s stub
  • Loading branch information
scottd018 authored May 21, 2021
1 parent 92388df commit 3418bcf
Show file tree
Hide file tree
Showing 22 changed files with 479 additions and 67 deletions.
60 changes: 60 additions & 0 deletions .github/action-unit-test/action.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
---
name: "Common Unit Test Action"
description: "Common Unit Test Action"

inputs:
component:
description: "RPK Component to Test"
required: true

runs:
using: "composite"
steps:
- name: "Setup KIND Unit Test Environment"
shell: "bash"
run: |
# setup kind
if [ -z $(which kind) ]; then
echo "kind executable not found...installing"
curl https://github.com/kubernetes-sigs/kind/releases/download/${KIND_VERSION}/kind-linux-amd64 -o /usr/local/bin/kind -L
chmod +x /usr/local/bin/kind
else
echo "found kind executable at $(which kind)...not installing"
fi
# setup kubectl
if [ -z $(which kubectl) ]; then
curl -LO https://dl.k8s.io/release/${KUBECTL_VERSION}/bin/linux/amd64/kubectl -o /usr/local/bin/kubectl
chmod +x /usr/local/bin/kubectl
else
echo "found kubectl executable at $(which kubectl)...not installing"
fi
env:
KIND_VERSION: "v0.10.0"
KUBECTL_VERSION: "v1.20.0"

- name: "Setup KIND Cluster"
shell: "bash"
run: "make setup.kind && make setup.kind.network"
env:
KIND_INVENTORY: "ci/clusters/kind-cluster-unit.yaml"
KIND_BASE_CONFIG: "ci/clusters/kind-cluster-config-unit.yaml"
KIND_CLUSTER: "rpk-kind"

- name: "Test Deployment"
shell: "bash"
run: ROLE=${RPK_COMPONENT} make deploy.test.role
env:
RPK_COMPONENT: ${{ inputs.component }}

- name: "Test Demo"
shell: "bash"
run: ROLE=${RPK_COMPONENT} make demo.test.role
env:
RPK_COMPONENT: ${{ inputs.component }}

- name: "Test Clean"
shell: "bash"
run: ROLE=${RPK_COMPONENT} make clean.test.role
env:
RPK_COMPONENT: ${{ inputs.component }}
19 changes: 10 additions & 9 deletions .github/workflows/dco.yaml
Original file line number Diff line number Diff line change
@@ -1,18 +1,19 @@
---
name: DCO Check
on: [pull_request]
name: "Commit Check"
on:
- "pull_request"

jobs:
check-commits:
runs-on: ubuntu-latest
name: Check Commits
runs-on: "ubuntu-latest"
name: "Check Commits"
steps:
- name: Get PR Commits
id: 'get-pr-commits'
uses: tim-actions/get-pr-commits@master
- name: "Get PR Commits"
id: "get-pr-commits"
uses: "tim-actions/get-pr-commits@master"
with:
token: ${{ secrets.GITHUB_TOKEN }}
- name: DCO Check
uses: tim-actions/dco@master
- name: "DCO Check"
uses: "tim-actions/dco@master"
with:
commits: ${{ steps.get-pr-commits.outputs.commits }}
98 changes: 98 additions & 0 deletions .github/workflows/e2e-test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
---
name: "End-to-End Test"
on:
pull_request:
branches:
- master
jobs:

detect-file-changes:
name: "Detect File Changes"
runs-on: "ubuntu-latest"
steps:
- name: "Checkout Code"
uses: "actions/checkout@v2"
with:
fetch-depth: 2
- name: "Detect File Changes"
uses: "tj-actions/changed-files@v6.2"
id: "changed-files"
- name: List all modified files
run: |
for file in "${{ steps.changed-files.outputs.all_changed_files }}"; do
echo "$file was modified"
done
outputs:
changed-files: ${{ steps.changed-files.outputs.all_changed_files }}

e2e-test-aws:
name: "E2E AWS"
runs-on: "ubuntu-latest"
needs: "detect-file-changes"
steps:
- name: "Checkout Code"
uses: "actions/checkout@v2"
- run: "echo 'placeholder for aws e2e testing'"
if: |
contains(needs.detect-file-changes.outputs.changed-files, 'roles/common') ||
contains(needs.detect-file-changes.outputs.changed-files, 'roles/components') ||
contains(needs.detect-file-changes.outputs.changed-files, 'lib/') ||
contains(needs.detect-file-changes.outputs.changed-files, 'bin/') ||
contains(needs.detect-file-changes.outputs.changed-files, 'profiles/') ||
contains(needs.detect-file-changes.outputs.changed-files, 'Dockerfile') ||
contains(needs.detect-file-changes.outputs.changed-files, 'Makefile') ||
contains(needs.detect-file-changes.outputs.changed-files, 'site.yaml')
e2e-test-azure:
name: "E2E Azure"
runs-on: "ubuntu-latest"
needs: "detect-file-changes"
steps:
- name: "Checkout Code"
uses: "actions/checkout@v2"
- run: "echo 'placeholder for azure e2e testing'"
if: |
contains(needs.detect-file-changes.outputs.changed-files, 'roles/common') ||
contains(needs.detect-file-changes.outputs.changed-files, 'roles/components') ||
contains(needs.detect-file-changes.outputs.changed-files, 'lib/') ||
contains(needs.detect-file-changes.outputs.changed-files, 'bin/') ||
contains(needs.detect-file-changes.outputs.changed-files, 'profiles/') ||
contains(needs.detect-file-changes.outputs.changed-files, 'Dockerfile') ||
contains(needs.detect-file-changes.outputs.changed-files, 'Makefile') ||
contains(needs.detect-file-changes.outputs.changed-files, 'site.yaml')
e2e-test-vmware:
name: "E2E VMware"
runs-on: "ubuntu-latest"
needs: "detect-file-changes"
steps:
- name: "Checkout Code"
uses: "actions/checkout@v2"
- run: "echo 'placeholder for vmware e2e testing'"
if: |
contains(needs.detect-file-changes.outputs.changed-files, 'roles/common') ||
contains(needs.detect-file-changes.outputs.changed-files, 'roles/components') ||
contains(needs.detect-file-changes.outputs.changed-files, 'lib/') ||
contains(needs.detect-file-changes.outputs.changed-files, 'bin/') ||
contains(needs.detect-file-changes.outputs.changed-files, 'profiles/') ||
contains(needs.detect-file-changes.outputs.changed-files, 'Dockerfile') ||
contains(needs.detect-file-changes.outputs.changed-files, 'Makefile') ||
contains(needs.detect-file-changes.outputs.changed-files, 'site.yaml')
e2e-test-v7wk8s:
name: "E2E TKGs (v7wk8s)"
runs-on: "ubuntu-latest"
needs: "detect-file-changes"
steps:
- name: "Checkout Code"
uses: "actions/checkout@v2"
- run: "echo 'placeholder for tkgs e2e testing'"
if: |
contains(needs.detect-file-changes.outputs.changed-files, 'roles/common') ||
contains(needs.detect-file-changes.outputs.changed-files, 'roles/components') ||
contains(needs.detect-file-changes.outputs.changed-files, 'lib/') ||
contains(needs.detect-file-changes.outputs.changed-files, 'bin/') ||
contains(needs.detect-file-changes.outputs.changed-files, 'profiles/') ||
contains(needs.detect-file-changes.outputs.changed-files, 'Dockerfile') ||
contains(needs.detect-file-changes.outputs.changed-files, 'Makefile') ||
contains(needs.detect-file-changes.outputs.changed-files, 'site.yaml')
16 changes: 8 additions & 8 deletions .github/workflows/license.yaml
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
---
name: Check License Lines
name: "License Check"
on:
- push
- pull_request
- "push"
- "pull_request"
jobs:
check-license-lines:
runs-on: ubuntu-latest
name: Check License Lines
runs-on: "ubuntu-latest"
name: "Check License Lines"
steps:
- uses: actions/checkout@master
- name: Check License Lines
uses: kt3k/license_checker@v1.0.6
- uses: "actions/checkout@master"
- name: "Check License Lines"
uses: "kt3k/license_checker@v1.0.6"
54 changes: 23 additions & 31 deletions .github/workflows/lint.yaml
Original file line number Diff line number Diff line change
@@ -1,46 +1,38 @@
---
name: Lint Project
name: "Lint"
on:
- push
- pull_request
- "push"
- "pull_request"
jobs:

lint-dirs:
name: Lint Directories
runs-on: ubuntu-latest
container:
image: projects.registry.vmware.com/rpk/rpk-base:v1.4.0
name: "Lint Directories"
runs-on: "ubuntu-latest"
steps:
- name: Checkout Code
uses: actions/checkout@master
- run: make lint.dirs
- name: "Checkout Code"
uses: "actions/checkout@master"
- run: "make lint.dirs"

lint-files:
name: Lint Files
runs-on: ubuntu-latest
container:
image: projects.registry.vmware.com/rpk/rpk-base:v1.4.0
name: "Lint Files"
runs-on: "ubuntu-latest"
steps:
- name: Checkout Code
uses: actions/checkout@master
- run: make lint.files
- name: "Checkout Code"
uses: "actions/checkout@master"
- run: "make lint.files"

lint-ansible:
name: Lint Ansible
runs-on: ubuntu-latest
container:
image: projects.registry.vmware.com/rpk/rpk-base:v1.4.0
name: "Lint Ansible"
runs-on: "ubuntu-latest"
steps:
- name: Checkout Code
uses: actions/checkout@master
- run: make lint.ansible
- name: "Checkout Code"
uses: "actions/checkout@master"
- run: "make lint.ansible"

lint-yaml:
name: Lint YAML
runs-on: ubuntu-latest
container:
image: projects.registry.vmware.com/rpk/rpk-base:v1.4.0
name: "Lint YAML"
runs-on: "ubuntu-latest"
steps:
- name: Checkout Code
uses: actions/checkout@master
- run: make lint.yaml
- name: "Checkout Code"
uses: "actions/checkout@master"
- run: "make lint.yaml"
Loading

0 comments on commit 3418bcf

Please sign in to comment.