-
Notifications
You must be signed in to change notification settings - Fork 1
92 lines (82 loc) · 2.67 KB
/
main.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
92
on:
workflow_dispatch:
inputs:
dispatch_token:
description: 'Token that authorize the dispatch'
required: true
head_sha:
description: 'Head commit SHA that dispatched the workflow'
required: true
pr_author_username:
description: 'Pull Request author username'
required: true
pr_number:
description: 'Pull Request number that dispatched the workflow'
required: true
jobs:
evaluator:
runs-on: self-hosted
services:
mongodb:
image: mongo
ports:
- "27017:27017"
options: -v ${{ github.workspace }}:/github/workspace
steps:
- name: Fetch project repository
uses: actions/checkout@v2
- name: Fetch Blocked Files Checkout action
uses: actions/checkout@v2
with:
repository: betrybe/blocked-files-checkout-action
ref: v2
token: ${{ secrets.GIT_HUB_PAT }}
path: .github/actions/blocked-files-checkout
- name: Fetch Flake8 linter
uses: actions/checkout@v2
with:
repository: betrybe/flake8-linter-action
ref: v1.3
token: ${{ secrets.GIT_HUB_PAT }}
path: .github/actions/flake8-linter
- name: Fetch PyTest evaluator
uses: actions/checkout@v2
with:
repository: betrybe/pytest-evaluator-action
ref: v5
token: ${{ secrets.GIT_HUB_PAT }}
path: .github/actions/pytest-evaluator
- name: Fetch Store evaluation
uses: actions/checkout@v2
with:
repository: betrybe/store-evaluation-action
ref: v2
token: ${{ secrets.GIT_HUB_PAT }}
path: .github/actions/store-evaluation
- name: Setup NodeJS
uses: actions/[email protected]
with:
node-version: '12'
- name: Restore protected files
uses: ./.github/actions/blocked-files-checkout
with:
restore_branch: 'main'
- name: Run Flake8 linter
uses: ./.github/actions/flake8-linter
with:
token: ${{ secrets.GITHUB_TOKEN }}
pr_number: ${{ github.event.inputs.pr_number }}
- name: Run PyTest evaluation
id: evaluator
uses: ./.github/actions/pytest-evaluator
with:
pr_author_username: ${{ github.event.inputs.pr_author_username }}
env:
DB_HOST: 'mongodb'
DB_PORT: '27017'
- name: Run Store evaluation
uses: ./.github/actions/store-evaluation
with:
evaluation-data: ${{ steps.evaluator.outputs.result }}
environment: production
pr-number: ${{ github.event.inputs.pr_number }}