build(deps): bump tj-actions/branch-names from 6 to 7.0.7 in /.github/workflows #171
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: end-to-end-test | |
on: | |
pull_request_target: | |
types: [ labeled ] | |
workflow_dispatch: | |
env: | |
chartuser: ${{ secrets.DEV_CHARTS_USERNAME }} | |
chartpassword: ${{ secrets.DEV_CHARTS_PASSWORD }} | |
ENFORCE_CRITICAL_CHECK: ${{ secrets.ENFORCE_CRITICAL_CHECK }} | |
permissions: | |
contents: write | |
pages: write | |
jobs: | |
end-to-end: | |
runs-on: ubuntu-20.04 | |
if: ${{ github.event.label.name == 'ready-to-test' }} | |
steps: | |
- name: checkout the repo | |
uses: actions/checkout@v3 | |
with: | |
ref: ${{ github.event.pull_request.head.sha }} | |
- name: Get branch name | |
id: branch-name | |
uses: tj-actions/[email protected] | |
- name: Set outputs | |
id: vars | |
run: echo "sha_commit=$(git rev-parse HEAD)" >> $GITHUB_OUTPUT | |
- name: build the kubeslice controller | |
uses: docker/build-push-action@v3 | |
with: | |
tags: kubeslice-controller:${{ steps.vars.outputs.sha_commit }} | |
build-args: | | |
PLATFORM=amd64 | |
push: false | |
- name: Scanning image for vulnerablilities | |
uses: aquasecurity/trivy-action@master | |
with: | |
image-ref: kubeslice-controller:${{ steps.vars.outputs.sha_commit }} | |
format: 'table' | |
output: 'scan.txt' | |
- name: check files | |
run: | | |
ls -ltr | |
cat scan.txt | |
- name: extract lines for base and binary image | |
run: | | |
bash .github/workflows/scripts/line-extractor.sh | |
- name: check file is created or not | |
run: | | |
ls -ltr | |
echo "base image file content:" | |
cat final.txt | |
echo "binary image file content:" | |
cat binary.txt | |
- name: break the bulid if critical vulunerablitites in base image | |
if: env.ENFORCE_CRITICAL_CHECK == 'true' | |
run: | | |
bash .github/workflows/scripts/base-image-critical.sh | |
- name: break the bulid if critical vulunerablitites in binary image | |
if: env.ENFORCE_CRITICAL_CHECK == 'true' | |
run: | | |
bash .github/workflows/scripts/binary-image-critical.sh | |
- name: Upload artifact | |
uses: actions/upload-artifact@v3 | |
with: | |
name: trivy-scan | |
path: scan.txt | |
- name: build kind clusters | |
run: | | |
mkdir -p ${{ github.workspace }}/profile | |
sh .github/workflows/scripts/start-kind.sh | |
env: | |
GITHUB_HEAD_COMMIT: ${{ steps.vars.outputs.sha_commit }} | |
- name: Docker Run Action | |
uses: addnab/docker-run-action@v3 | |
with: | |
image: aveshadev/kubeslice-e2e:latest | |
options: -v ${{ github.workspace }}/reports:/e2e/reports -v /home/runner/.kube:/e2e/assets/kubeconfig -v ${{ github.workspace }}/profile:/e2e/profile --network kind | |
run: | | |
bash run.sh kind | |
- name: Checkout gh-pages repo | |
uses: actions/checkout@v3 | |
with: | |
repository: kubeslice/e2e-allure-reports | |
path: gh-pages | |
ref: 'gh-pages' | |
- name: Get current date | |
id: date | |
run: echo "::set-output name=date::$(date +'%Y-%m-%dT%H:%M:%S')" | |
- name: Allure Report with history | |
uses: PavanMudigonda/[email protected] | |
id: Allure_report_with_history | |
with: | |
allure_results: reports | |
allure_report: allure_report | |
allure_history: allure-history | |
gh_pages: gh-pages | |
keep_reports: 500 | |
github_run_id: '${{ github.run_id }}' | |
github_run_num: 'Kind-${{ github.event.repository.name }}-${{ steps.date.outputs.date }}-${{ github.base_ref }}-${{ github.run_number }}' | |
report_url: 'https://kubeslice.github.io/e2e-allure-reports/' | |
test_env: Kind | |
- name: Create lockfile | |
run: touch gh-pages/lockfile | |
- name: Acquire lock | |
run: | | |
flock gh-pages/lockfile -c ' | |
git -C gh-pages pull origin gh-pages | |
eval $(ssh-agent -s) | |
echo "${{ secrets.E2E_ALLURE_REPORTS_PRIVATE_KEY }}" | ssh-add - | |
git -C gh-pages push [email protected]:kubeslice/e2e-allure-reports.git gh-pages | |
' | |
env: | |
SSH_AUTH_SOCK: /tmp/ssh_agent.sock | |
- name: Deploy report to Github Pages | |
uses: peaceiris/actions-gh-pages@v3 | |
with: | |
publish_branch: gh-pages | |
deploy_key: ${{ secrets.E2E_ALLURE_REPORTS_PRIVATE_KEY }} | |
external_repository: kubeslice/e2e-allure-reports | |
publish_dir: allure-history | |
keep_files: true | |
- name: wait for report deploy on site ( you can check report here also ) | |
run: | | |
sleep 200 | |
echo 'https://kubeslice.github.io/e2e-allure-reports/Kind-${{ github.event.repository.name }}-${{ steps.date.outputs.date }}-${{ github.base_ref }}-${{ github.run_number }}/index.html' | |
- name: Report link on Pull Request comment | |
uses: thollander/actions-comment-pull-request@v2 | |
with: | |
message: | | |
report link 'https://kubeslice.github.io/e2e-allure-reports/Kind-${{ github.event.repository.name }}-${{ steps.date.outputs.date }}-${{ github.base_ref }}-${{ github.run_number }}/index.html' | |
GITHUB_TOKEN: ${{ secrets.TOKEN }} | |
- name: Run Quality Gate Check | |
uses: ./quality-gate | |
with: | |
ENABLE_QUALITY_GATE: true | |
MINIMUM_PASS_PERCENTAGE: 75 | |
ALLURE_BEHAVIORS_CSV: '/home/runner/work/${{ github.event.repository.name }}/${{ github.event.repository.name }}/allure-history/Kind-${{ github.event.repository.name }}-${{ steps.date.outputs.date }}-${{ github.base_ref }}-${{ github.run_number }}/data/behaviors.csv' | |
- name: Send mail | |
if: always() | |
uses: dawidd6/action-send-mail@v3 | |
with: | |
server_address: smtp.gmail.com | |
server_port: 465 | |
username: ${{secrets.MAIL_USERNAME}} | |
password: ${{secrets.MAIL_PASSWORD}} | |
cc: [email protected], [email protected], [email protected] | |
subject: Kubeslice-controller | controller-end-to-end-test | ${{ steps.date.outputs.date }} | |
to: [email protected], [email protected] | |
from: [email protected] | |
attachments: result-summary.txt | |
body: Pipeline for the repo ${{github.repository}} is triggered by ${{github.actor}} from the branch ${{ steps.branch-name.outputs.current_branch }} ! | |
Run id for the pipeline is ${{ github.run_id }} . | |
Check your logs in github action here https://github.com/kubeslice/kubeslice-controller/actions/runs/${{ github.run_id }} . | |
for downloading the logs zip file in your local use this API url in curl command https://api.github.com/repos/kubeslice/kubeslice-controller/actions/runs/${{ github.run_id }}/logs | |
the report url is https://kubeslice.github.io/e2e-allure-reports/Kind-${{ github.event.repository.name }}-${{ steps.date.outputs.date }}-${{ github.base_ref }}-${{ github.run_number }}/index.html. | |
for looking all the allure reports (including old ones ) please visit at https://kubeslice.github.io/e2e-allure-reports/ . | |
please look result-summary.txt file for more info regarding test cases ( please note you will get result-summary.txt file only if your quality gate check steps ran successfully ). |