Skip to content

Commit 877b28d

Browse files
Create bot.yaml
1 parent 7f114e6 commit 877b28d

File tree

1 file changed

+57
-0
lines changed

1 file changed

+57
-0
lines changed

.github/workflows/bot.yaml

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
name: Bot validation
2+
3+
on:
4+
push:
5+
paths:
6+
- 'caltechdata_api/cli.py'
7+
- 'caltechdata_api/customize_schema.py'
8+
- 'caltechdata_api/caltechdata_write.py'
9+
- 'caltechdata_api/caltechdata_edit.py'
10+
- 'README.md'
11+
pull_request:
12+
paths:
13+
- 'caltechdata_api/cli.py'
14+
- 'caltechdata_api/customize_schema.py'
15+
- 'caltechdata_api/caltechdata_write.py'
16+
- 'caltechdata_api/caltechdata_edit.py'
17+
- 'README.md'
18+
19+
jobs:
20+
validate-metadata:
21+
runs-on: ubuntu-latest
22+
23+
steps:
24+
- uses: actions/checkout@v4
25+
with:
26+
fetch-depth: 0
27+
28+
- name: Set up Python
29+
uses: actions/setup-python@v4
30+
with:
31+
python-version: '3.x'
32+
33+
- name: Check for Required Environment Variables
34+
env:
35+
CALTECHDATA_TOKEN: ${{ secrets.CALTECHDATA_TOKEN }}
36+
run: |
37+
if [ -z "$CALTECHDATA_TOKEN" ]; then
38+
echo "Error: CALTECHDATA_TOKEN environment variable is not set"
39+
exit 1
40+
fi
41+
42+
- name: Install dependencies
43+
run: |
44+
python -m pip install --upgrade pip
45+
pip install pytest requests s3fs cryptography
46+
pip install .
47+
48+
- name: Run CaltechDATA Metadata Validation
49+
env:
50+
CALTECHDATA_TOKEN: ${{ secrets.CALTECHDATA_TOKEN }}
51+
run: |
52+
python tests/bot_yaml.py
53+
- name: Run Unit Tests
54+
run: |
55+
cd tests
56+
pytest test_unit.py
57+
pytest test_rdm.py

0 commit comments

Comments
 (0)