Integration test cleanup #20
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 |