-
Notifications
You must be signed in to change notification settings - Fork 0
71 lines (66 loc) · 2.76 KB
/
Cron_Action.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
name: Run Cron Job On GitHub Action
run-name: Cron Run ${{ inputs.working-directory }} by @${{ github.actor }}
on:
schedule: #runs at 15:00 UTC / 10AM EST everyday
- cron: "0 7 * * *"
workflow_dispatch: # Allows to trigger the workflow manually in GitHub UI
inputs:
working-directory:
required: true
type: string
default: 'src'
description: "From which folder this pipeline executes"
env:
PYTHON_VERSION: "3.11"
POETRY_VERSION: "1.7.1"
jobs:
cron-run:
runs-on: ubuntu-latest
environment: Chris Queen CPCC
steps:
- name: Checking out repo
uses: actions/checkout@v4
- name: Set up Python + Poetry ${{ env.POETRY_VERSION }}
uses: "./.github/actions/poetry_setup"
with:
python-version: ${{ env.PYTHON_VERSION }}
poetry-version: ${{ env.POETRY_VERSION }}
working-directory: ${{ inputs.working-directory }}
cache-key: release
- name: Install dependencies
working-directory: ${{ inputs.working-directory }}
shell: bash
run: |
echo "Running cron action, installing dependencies with poetry..."
poetry install --with=test_integration,test
# Need to fetch reqs if needed from external libraries
- name: Install deps outside pyproject
run: sudo apt-get install xvfb
#- name: Lint with flake8
# run: |
# # stop the build if there are Python syntax errors or undefined names
# flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
# # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
# flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
- name: execute cron script # run file
shell: bash
env:
GITHUB_ACTION_TRUE: "True"
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
INSTRUCTOR_PASS: ${{ secrets.INSTRUCTOR_PASS }}
INSTRUCTOR_USERID: ${{ secrets.INSTRUCTOR_USERID }}
FEEDBACK_SIGNATURE: ${{ vars.FEEDBACK_SIGNATURE}}
HEADLESS_BROWSER : ${{ vars.HEADLESS_BROWSER }}
MAX_WAIT_RETRY : ${{ vars.MAX_WAIT_RETRY }}
RETRY_PARSER_MAX_RETRY : ${{ vars.RETRY_PARSER_MAX_RETRY }}
SHOW_ERROR_LINE_NUMBERS : ${{ vars.SHOW_ERROR_LINE_NUMBERS }}
WAIT_DEFAULT_TIMEOUT : ${{ vars.WAIT_DEFAULT_TIMEOUT }}
run: |
poetry run python cron.py
#- name: Commit and Push The Results From Cron Action
# run: |
# git config --global user.name "github-actions[bot]"
# git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com"
# git add -A
# git commit -m "GitHub Actions Results added"
# git push