Skip to content

Implemented Integration test and removed test folders #4

Implemented Integration test and removed test folders

Implemented Integration test and removed test folders #4

Workflow file for this run

name: Release
on:
push:
tags:
- 'v*'
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
python-version: 3.11
- name: Checkout Own Repo
uses: actions/checkout@v4
with:
repository: LWJ-Nicholas/DevOps_Oct2023_TeamC_Assignment
- name: Install Libraries
run: |
python -m pip install --upgrade pip
python -m pip install -r requirements.txt
- name: list our contents
run: |
ls
- name: test with pytest
run: |
python -m pytest --junitxml=test.xml
- if: ${{ failure() }}
uses: JasonEtco/create-an-issue@v2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
filename: .github/ISSUE_TEMPLATE.md
- name: Publish Test Results
uses: EnricoMi/publish-unit-test-result-action/composite@v2
if: always()
with:
junit_files: "report.xml"
- name: create folder
run: mkdir downloads
- name: move files
run: mv *.xml ./downloads
- name: Remove test files
run: find . -type f -name 'test_*' -delete
- name: Checkout Testing Repo
uses: actions/checkout@v2
with:
repository: LWJ-Nicholas/DevOps_ASG_Integration_Tests
path: IntegrationTests
- name: Run Integration tests
env:
SELENIUM_BROWSER: headlesschrome
run: |
robot .
- name: Create Issue on Failed workflow
if: ${{ failure() }}
id: create_issue
uses: dacbd/create-issue-action@main
with:
token: ${{ github.token }}
title: Action workflow failed.
body: |
### Context
[Failed Run](https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }})
[Codebase](https://github.com/${{ github.repository }}/tree/${{ github.sha }})
Workflow name - `${{ github.workflow }}`
Job - `${{ github.job }}`
status - `${{ job.status }}`
assignees: LWJ-Nicholas
- name: Remove test files
run: find . -type f -name 'test_*' -delete
- name: Upload document
uses: actions/upload-artifact@v2
with:
name: assetDocuments
path: downloads
- name: Set environment version
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
- name: download remote information
uses: actions/download-artifact@v2
with:
name: assetDocuments
- name: create release
id: create-new-release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
with:
tag_name: ${{ env.RELEASE_VERSION }}
release_name: Release ${{env.RELEASE_VERSION }}
- name: Archive site content
uses: thedoctor0/zip-release@master
with:
filename: content.zip
- name: upload release asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN}}
with:
upload_url: ${{ steps.create-new-release.outputs.upload_url }}
asset_path: ./content.zip
asset_name: ${{ env.RELEASE_VERSION }}.zip
asset_content_type: applications/zip