-
Notifications
You must be signed in to change notification settings - Fork 2
45 lines (43 loc) · 1.3 KB
/
run-python-scripts.yml
File metadata and controls
45 lines (43 loc) · 1.3 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
39
40
41
42
43
44
45
name: Run Python Scripts
on:
schedule:
- cron: '0 22 * * 1-5' # Runs at 10:00 PM UTC Monday to Friday (5:00 PM EST or 6:00 PM EDT)
pull_request:
workflow_dispatch:
inputs:
date:
description: 'Optional date in YYYY-MM-DD format'
required: false
jobs:
Run-Python-Scripts:
runs-on: ubuntu-latest
strategy:
matrix:
fund: [core, benchmark]
permissions:
contents: write
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '>=3.10'
cache: pip
- name: Install dependencies
run: |
python3 -m pip install --upgrade pip
pip install -r requirements.txt
- name: Run Unit Tests
run: python -m unittest discover tests
- name: Determine Date to Use
id: determine_date
run: |
if [ -n "${{ github.event.inputs.date }}" ]; then
echo "Using provided date: ${{ github.event.inputs.date }}"
echo "date=${{ github.event.inputs.date }}" >> $GITHUB_OUTPUT
else
CURRENT_DATE=$(date +'%Y-%m-%d')
echo "Using current date: $CURRENT_DATE"
echo "date=$CURRENT_DATE" >> $GITHUB_OUTPUT
fi