2019-11-08 09:31:16 -05:00
|
|
|
---
|
|
|
|
#########################
|
|
|
|
#########################
|
|
|
|
## Deploy Docker Image ##
|
|
|
|
#########################
|
|
|
|
#########################
|
|
|
|
|
|
|
|
#
|
|
|
|
# Documentation:
|
|
|
|
# https://help.github.com/en/articles/workflow-syntax-for-github-actions
|
|
|
|
#
|
|
|
|
|
|
|
|
#######################################
|
|
|
|
# Start the job on all push to master #
|
|
|
|
#######################################
|
2020-01-09 14:04:41 -05:00
|
|
|
#############################
|
|
|
|
# Start the job on all push #
|
|
|
|
#############################
|
2019-11-08 09:39:18 -05:00
|
|
|
on:
|
|
|
|
push:
|
2020-07-21 13:08:50 -04:00
|
|
|
branches-ignore: [master]
|
|
|
|
pull_request:
|
|
|
|
branches-ignore: []
|
2019-11-08 09:31:16 -05:00
|
|
|
|
|
|
|
###############
|
|
|
|
# Set the Job #
|
|
|
|
###############
|
|
|
|
jobs:
|
|
|
|
build:
|
|
|
|
# Name the Job
|
2020-01-09 14:04:41 -05:00
|
|
|
name: Deploy Docker Image - DEV
|
2019-11-08 09:31:16 -05:00
|
|
|
# Set the agent to run on
|
|
|
|
runs-on: ubuntu-latest
|
2020-07-01 09:35:15 -04:00
|
|
|
# Prevent duplicate run from happening when a forked push is committed
|
|
|
|
if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository
|
2019-11-08 09:31:16 -05:00
|
|
|
##################
|
|
|
|
# Load all steps #
|
|
|
|
##################
|
|
|
|
steps:
|
2019-11-08 09:45:57 -05:00
|
|
|
##########################
|
|
|
|
# Checkout the code base #
|
|
|
|
##########################
|
|
|
|
- name: Checkout Code
|
2020-11-04 00:43:17 -05:00
|
|
|
uses: actions/checkout@v2.3.4
|
2019-11-08 09:45:57 -05:00
|
|
|
|
2020-09-04 05:26:13 -04:00
|
|
|
########################
|
|
|
|
# Get the current date #
|
|
|
|
########################
|
|
|
|
- name: Get current date
|
|
|
|
run: echo "::set-env name=BUILD_DATE::$(date -u +'%Y-%m-%dT%H:%M:%SZ')"
|
|
|
|
|
2020-06-25 10:26:59 -04:00
|
|
|
###################################
|
|
|
|
# Build image locally for testing #
|
|
|
|
###################################
|
|
|
|
- name: Build image
|
2019-11-08 09:31:16 -05:00
|
|
|
shell: bash
|
2020-09-04 05:26:13 -04:00
|
|
|
run: docker build --build-arg "BUILD_DATE=${BUILD_DATE}" --build-arg "BUILD_REVISION=${GITHUB_SHA}" --build-arg "BUILD_VERSION=${GITHUB_SHA}" --no-cache -t github/super-linter:${GITHUB_SHA} .
|
2020-02-04 16:58:06 -05:00
|
|
|
|
2020-09-04 10:52:04 -04:00
|
|
|
########################################
|
|
|
|
# Validates the metadata docker labels #
|
|
|
|
########################################
|
|
|
|
- name: Run Docker label test cases
|
|
|
|
shell: bash
|
|
|
|
run: .automation/validate-docker-labels.sh
|
|
|
|
|
2020-08-06 14:16:23 -04:00
|
|
|
#####################################
|
|
|
|
# Run Linter against Test code base #
|
|
|
|
#####################################
|
2020-02-04 12:49:07 -05:00
|
|
|
- name: Run Test Cases
|
2020-02-04 15:52:18 -05:00
|
|
|
shell: bash
|
2020-10-15 05:41:44 -04:00
|
|
|
run: docker run -e RUN_LOCAL=true -e TEST_CASE_RUN=true -e OUTPUT_FORMAT=tap -e OUTPUT_FOLDER=${GITHUB_SHA} -e OUTPUT_DETAILS=detailed -e ACTIONS_RUNNER_DEBUG=true -v ${GITHUB_WORKSPACE}:/tmp/lint github/super-linter:${GITHUB_SHA}
|
2020-08-06 14:16:23 -04:00
|
|
|
|
|
|
|
#########################################
|
2020-09-21 18:53:30 -04:00
|
|
|
# Clean code base to run against it all #
|
2020-08-06 14:16:23 -04:00
|
|
|
#########################################
|
|
|
|
- name: Clean Test code base for additional testing
|
|
|
|
shell: bash
|
|
|
|
run: .automation/clean-code-base-for-tests.sh
|
|
|
|
|
|
|
|
############################################
|
|
|
|
# Run Linter against ALL cleaned code base #
|
|
|
|
############################################
|
|
|
|
- name: Run against all code base
|
|
|
|
shell: bash
|
2020-10-14 04:59:34 -04:00
|
|
|
run: docker run -e RUN_LOCAL=true -e OUTPUT_DETAILS=detailed -e ACTIONS_RUNNER_DEBUG=true -v ${GITHUB_WORKSPACE}:/tmp/lint github/super-linter:${GITHUB_SHA}
|