Skip to content

Commit

Permalink
[Cherry-Pick for 1.13.6] (#29)
Browse files Browse the repository at this point in the history
* Chore(actions): Add GitHub actions inplace of travis and fix lint failure (#28)

Signed-off-by: udit <[email protected]>

* chore(chaosresult): update the chaosresult template (#26)

Signed-off-by: shubhamchaudhary <[email protected]>

* update the version of pull request workflow

Signed-off-by: udit <[email protected]>

Co-authored-by: Shubham Chaudhary <[email protected]>
  • Loading branch information
uditgaurav and ispeakc0de authored Jun 15, 2021
1 parent 621671a commit feed4b0
Show file tree
Hide file tree
Showing 9 changed files with 208 additions and 210 deletions.
File renamed without changes.
101 changes: 101 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
---
name: litmus-ansible-ci
on:
pull_request:
branches:
- v1.13.x
push:
branches:
- master
tags-ignore:
- '**'

env:
DOCKER_REPO: litmuschaos
DOCKER_IMAGE: ansible-runner
DOCKER_TAG: ci

defaults:
run:
shell: bash

jobs:

build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2

- name: Build Image
env:
SAVE_PATH: ${{ github.workspace }}
run: |
make build
make save
chmod +x ${{ github.workspace }}/image.tar
- name: Upload artifact
uses: actions/upload-artifact@v2
with:
name: myimage
path: |
${{ github.workspace }}/image.tar
${{ github.workspace }}/tag.txt
image-checks:
runs-on: ubuntu-latest
needs: build
steps:
- name: Checkout
uses: actions/checkout@v2

- name: Download artifact
uses: actions/download-artifact@v2
with:
name: myimage
path: ${{ github.workspace }}

- name: Load Docker image
run: |
docker load --input ${{ github.workspace }}/image.tar
- name: checking dependencies are installed
run: make deps

- name: Running ansible syntax-checks
run: make syntax-checks

- name: Running ansible lint-checks
run: make lint-checks

- name: Running trivy check
run: |
wget https://github.com/aquasecurity/trivy/releases/download/v0.11.0/trivy_0.11.0_Linux-64bit.tar.gz
tar zxvf trivy_0.11.0_Linux-64bit.tar.gz
make security-checks
push:
runs-on: ubuntu-latest
needs: [build,image-checks]
if: github.event_name == 'push'
steps:
- name: Checkout
uses: actions/checkout@v2

- name: Download artifact
uses: actions/download-artifact@v2
with:
name: myimage
path: ${{ github.workspace }}

- name: Load Docker image
run: |
docker load --input ${{ github.workspace }}/image.tar
- name: Push Image
env:
DNAME: ${{ secrets.DNAME }}
DPASS: ${{ secrets.DPASS }}
run: |
make push
173 changes: 0 additions & 173 deletions .github/workflows/main.yml

This file was deleted.

77 changes: 77 additions & 0 deletions .github/workflows/release-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
---
name: release

on:
create:
tags:
- '**'

env:
DOCKER_REPO: litmuschaos
DOCKER_IMAGE: ansible-runner

defaults:
run:
shell: bash

jobs:
release-build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2

- name: Set Tag
run: |
TAG="${GITHUB_REF#refs/*/}"
echo "TAG=${TAG}" >> $GITHUB_ENV
echo "RELEASE_TAG=${TAG}" >> $GITHUB_ENV
- name: Print Tag info
run: |
echo "RELEASE TAG: ${RELEASE_TAG}"
echo "${RELEASE_TAG}" > ${{ github.workspace }}/tag.txt
- name: Build Image
env:
DOCKER_TAG: ${RELEASE_TAG}
SAVE_PATH: ${{ github.workspace }}
run: |
make build
make save
chmod +x ${{ github.workspace }}/image.tar
- name: Upload artifact
uses: actions/upload-artifact@v2
with:
name: myimage
path: |
${{ github.workspace }}/image.tar
${{ github.workspace }}/tag.txt
release-push:
runs-on: ubuntu-latest
needs: [release-build]
steps:
- name: Checkout
uses: actions/checkout@v2

- name: Download artifact
uses: actions/download-artifact@v2
with:
name: myimage
path: ${{ github.workspace }}

- name: Load Docker image
run: |
docker load --input ${{ github.workspace }}/image.tar
RELEASE_TAG=`cat ${{ github.workspace }}/tag.txt`
echo "RELEASE_TAG=${RELEASE_TAG}" >> $GITHUB_ENV
- name: Push Image
env:
DOCKER_TAG: ${RELEASE_TAG}
DNAME: ${{ secrets.DNAME }}
DPASS: ${{ secrets.DPASS }}
run: |
make push
22 changes: 0 additions & 22 deletions .travis.yml

This file was deleted.

Loading

0 comments on commit feed4b0

Please sign in to comment.