Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding testing pipline to the testing branch #1471

Merged

Conversation

ZinnurovArtur
Copy link
Collaborator

A testing pipeline is going to be added to the test branch to see in the working environment.

There are currently implemented several features:

  1. Application run simulation
  2. Selenium
  3. Database set up
  4. Allure report
  5. Pytest

.github/workflows/testing-pipline.yml Outdated Show resolved Hide resolved
.github/workflows/testing-pipline.yml Outdated Show resolved Hide resolved
.github/workflows/testing-pipline.yml Show resolved Hide resolved

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This may not work. Depends if this template gets evaluated when github.event_name is defined.

cancel-in-progress: ${{ github.event_name == 'pull_request' }}

If this works it will be great. Otherwise set this to false.

on:
pull_request:
paths:
- 'CodeListLibrary_project/**'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add an on. condition to handle when the PR gets merged into main.

on:
  push:
    branches: 
      - main
    paths:
      - 'CodeListLibrary_project/**'
  pull_request:
    paths:
      - 'CodeListLibrary_project/**'

You can later conditionally test if github.event_name == 'pull_request' to run the steps for pushing to gh-pages only when this is a merge into main.

python manage.py runserver 0.0.0.0:8000 > /dev/null &

- name: Run tests
if: success() || failure()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove if statement.

DISPLAY: ":99"

- name: Coverage report
if: success() || failure()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if: always()

minimum_coverage: 25

- name: Upload Test Results
if: success() || failure()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if: always()


- name: Get Allure history
uses: actions/checkout@v3
if: success() || failure() && github.event_name != 'pull_request'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if: always() && github.event_name != 'pull_request'

path: gh-pages

- name: Allure report action # Step to generate Allure report
if: success() || failure() && github.event_name != 'pull_request'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if: always() && github.event_name != 'pull_request'


- name: Upload an artifact for GitHub Pages
uses: actions/upload-pages-artifact@v2
if: success() || failure() && github.event_name != 'pull_request'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if: always() && github.event_name != 'pull_request'

path: CodeListLibrary_project/clinicalcode/tests/allure-report

- name: Deploy report to gh-pages branch
if: always() && github.event_name != 'pull_request'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if: always() && github.event_name != 'pull_request'

@ZinnurovArtur ZinnurovArtur marked this pull request as ready for review December 8, 2023 11:08
@ZinnurovArtur ZinnurovArtur merged commit 17a24e6 into SwanseaUniversityMedical:test-pipline Dec 8, 2023
2 of 4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Backend To be considered in or relates to backend development Unit Test Automated unit test
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants