-
Notifications
You must be signed in to change notification settings - Fork 1
91 lines (79 loc) · 2.47 KB
/
PullRequest.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
name: Pull Request
on:
pull_request:
branches: [main]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/setup-python@v4
with:
python-version: 3.11
- name: Checkout Own Repo
uses: actions/checkout@v4
with:
repository: LWJ-Nicholas/DevOps_Oct2023_TeamC_Assignment
- name: Install Library Dependencies
run: |
python -m pip install --upgrade pip
python -m pip install -r requirements.txt
- name: list the contents
run: |
ls
- name: Start Flask server
run: |
python main.py &
- name: test with pytest
run: |
python -m pytest --junitxml=test.xml
- name: Setup ChromeDriver
uses: nanasess/setup-chromedriver@master
- name: Run Robot Framework 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: Request approval
if: ${{ success() }}
uses: actions/github-script@v5
with:
script: |
const prComment = {
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.issue.number,
body: '@HanisahMusrin can you please approve this pull request?'
};
github.rest.issues.createComment(prComment);
- name: Publish Test Results
uses: EnricoMi/publish-unit-test-result-action/composite@v2
if: always()
with:
junit_files: "report.xml"
- name: Auto Merge pull request
uses: pascalgn/automerge-action@v0.14.3
with:
MERGE_LABELS: "automerge,!wip"
MERGE_METHOD: "merge"
MERGE_COMMIT_MESSAGE: "automatic"
MERGE_FORKS: "false"
UPDATE_LABELS: ""
MERGE_RETRIES: "6"
MERGE_RETRY_SLEEP: "10000"
MERGE_DELETE_BRANCH: "false"
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"