forked from phantomcyber/phantom-apps
-
Notifications
You must be signed in to change notification settings - Fork 1
38 lines (34 loc) · 1.24 KB
/
test-pr-commit.yml
File metadata and controls
38 lines (34 loc) · 1.24 KB
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
name: Test Pull Request Commit
on:
pull_request_target:
paths:
- 'Apps/**'
env:
SCRIPTS_DIRECTORY: .github/workflows/scripts
PYTHON_REQUIREMENTS_FILE: .github/workflows/scripts/requirements.txt
jobs:
test-pull-request-commit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Setup Python
uses: actions/setup-python@v2
with:
python-version: '3.8'
- name: Cache pip
uses: actions/cache@v2
with:
# This path is specific to Ubuntu
path: ~/.cache/pip
# Look to see if there is a cache hit for the corresponding requirements file
key: ${{ runner.os }}-pip-${{ hashFiles(env.PYTHON_REQUIREMENTS_FILE) }}
restore-keys: |
${{ runner.os }}-pip-
${{ runner.os }}-
- name: Install dependencies
run: pip install -r ${{ env.PYTHON_REQUIREMENTS_FILE }}
- name: Test pull request
env:
APPS_TEST_SERVER_URI: ${{ secrets.APPS_TEST_SERVER_URI }}
APPS_TEST_SERVER_API_KEY: ${{ secrets.APPS_TEST_SERVER_API_KEY }}
run: python ${{ env.SCRIPTS_DIRECTORY }}/test_pull_request.py ${{ github.event.number }} --requester '${{ github.event.sender.login }}'