forked from Sage-Bionetworks/synapsePythonClient
-
Notifications
You must be signed in to change notification settings - Fork 0
110 lines (95 loc) · 3.63 KB
/
test-cleanup.yml
File metadata and controls
110 lines (95 loc) · 3.63 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
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
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
name: "Integration test cleanup"
on:
schedule:
# Run every Friday at 10:00 PM Eastern Time (3:00 AM UTC Saturday)
- cron: '0 3 * * 6'
workflow_dispatch: # Allow manual triggering
jobs:
cleanup:
name: Delete resources
runs-on: ubuntu-latest
permissions:
contents: read
strategy:
matrix:
synapse_profile:
- "TestUbuntuMinimumPython"
- "TestUbuntuMaximumPython"
- "TestWindowsMinimumPython"
- "TestWindowsMaximumPython"
- "TestMacosMinimumPython"
- "TestMacosMaximumPython"
- "" # Empty string for default profile (no SYNAPSE_PROFILE set)
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.13'
- name: get-dependencies-location
shell: bash
run: |
SITE_PACKAGES_LOCATION=$(python -c "from sysconfig import get_path; print(get_path('purelib'))")
SITE_BIN_DIR=$(python3 -c "import os; import platform; import sysconfig; pre = sysconfig.get_config_var('prefix'); bindir = os.path.join(pre, 'Scripts' if platform.system() == 'Windows' else 'bin'); print(bindir)")
echo "site_packages_loc=$SITE_PACKAGES_LOCATION" >> $GITHUB_OUTPUT
echo "site_bin_dir=$SITE_BIN_DIR" >> $GITHUB_OUTPUT
id: get-dependencies
- name: Cache py-dependencies
id: cache-dependencies
uses: actions/cache@v4
env:
cache-name: cache-py-dependencies-cleanup
with:
path: |
${{ steps.get-dependencies.outputs.site_packages_loc }}
${{ steps.get-dependencies.outputs.site_bin_dir }}
key: ${{ runner.os }}-3.13-build-${{ env.cache-name }}-${{ hashFiles('setup.py') }}-v1
- name: Install py-dependencies
if: steps.cache-dependencies.outputs.cache-hit != 'true'
shell: bash
run: |
python -m pip install --upgrade pip
pip install -e ".[boto3,pandas,pysftp,tests]"
# ensure that numpy c extensions are installed on windows
# https://stackoverflow.com/a/59346525
if [ "${{startsWith(runner.os, 'Windows')}}" == "true" ]; then
pip uninstall -y numpy
pip uninstall -y setuptools
pip install setuptools
pip install numpy
fi
- name: Set up Synapse credentials
shell: bash
run: |
# decrypt the encrypted test synapse configuration
openssl aes-256-cbc -K ${{ secrets.encrypted_d17283647768_key }} -iv ${{ secrets.encrypted_d17283647768_iv }} -in test.synapseConfig.enc -out test.synapseConfig -d
mv test.synapseConfig ~/.synapseConfig
- name: Run evaluation deletion script
shell: bash
run: |
if [ -n "${{ matrix.synapse_profile }}" ]; then
export SYNAPSE_PROFILE="${{ matrix.synapse_profile }}"
fi
python .github/scripts/delete_evaluations.py
- name: Run project deletion script
shell: bash
run: |
if [ -n "${{ matrix.synapse_profile }}" ]; then
export SYNAPSE_PROFILE="${{ matrix.synapse_profile }}"
fi
python .github/scripts/delete_projects.py
- name: Run team deletion script
shell: bash
run: |
if [ -n "${{ matrix.synapse_profile }}" ]; then
export SYNAPSE_PROFILE="${{ matrix.synapse_profile }}"
fi
python .github/scripts/delete_teams.py
- name: Run empty trash script
shell: bash
run: |
if [ -n "${{ matrix.synapse_profile }}" ]; then
export SYNAPSE_PROFILE="${{ matrix.synapse_profile }}"
fi
python .github/scripts/empty_trash.py