forked from spyder-ide/spyder
-
Notifications
You must be signed in to change notification settings - Fork 0
120 lines (104 loc) · 3.13 KB
/
purge-cache.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
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
111
112
113
114
115
116
117
118
119
120
name: Purge caches
on:
schedule:
# 4:10 UTC Sunday
- cron: "10 4 * * 0"
workflow_dispatch:
jobs:
purge-cache:
runs-on: ubuntu-latest
permissions:
actions: write
steps:
- name: Purge Cache
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
REPO=${{ github.repository }}
gh cache list --repo $REPO
## Setting this to not fail the workflow while deleting cache keys.
set +e
gh cache delete --repo $REPO --all
# Last command must be successful so that workflow step does not fail
echo Purging cache is complete.
rebuild-test-caches:
name: ${{ matrix.os }} ${{ matrix.INSTALL_TYPE }} ${{ matrix.PYTHON_VERSION }}
needs: purge-cache
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-20.04]
INSTALL_TYPE: [pip, conda]
PYTHON_VERSION: ['3.8', '3.10', '3.12']
include:
- os: ubuntu-latest
INSTALL_TYPE: conda
PYTHON_VERSION: '3.9'
- os: macos-13
INSTALL_TYPE: conda
PYTHON_VERSION: '3.11'
- os: windows-latest
INSTALL_TYPE: pip
PYTHON_VERSION: '3.11'
- os: windows-latest
INSTALL_TYPE: conda
PYTHON_VERSION: '3.11'
steps:
- name: Checkout Push
uses: actions/checkout@v4
- name: Cache conda
uses: actions/cache@v4
with:
path: ~/conda_pkgs_dir
key: ${{ runner.os }}-cacheconda-install${{ matrix.INSTALL_TYPE }}-${{ matrix.PYTHON_VERSION }}-${{ hashFiles('requirements/*.yml') }}
- name: Cache pip
uses: actions/cache@v4
with:
path: ~/.cache/pip
key: ${{ runner.os }}-cachepip-install${{ matrix.INSTALL_TYPE }}-${{ hashFiles('setup.py') }}
- name: Create test environment
if: matrix.INSTALL_TYPE == 'conda'
uses: mamba-org/setup-micromamba@v2
with:
micromamba-version: '1.5.10-0'
environment-file: requirements/main.yml
environment-name: test
cache-downloads: true
cache-downloads-key: micromamba-downloads-test-${{ matrix.PYTHON_VERSION }}
create-args: python=${{ matrix.PYTHON_VERSION }}
build-subrepos:
name: Build subrepos
needs:
- purge-cache
uses: ./.github/workflows/build-subrepos.yml
run-test-files:
name: Run test-files
needs:
- purge-cache
- rebuild-test-caches
uses: ./.github/workflows/test-files.yml
run-test-linux:
name: Run test-linux
needs:
- purge-cache
- rebuild-test-caches
uses: ./.github/workflows/test-linux.yml
run-test-mac:
name: Run test-mac
needs:
- purge-cache
- rebuild-test-caches
uses: ./.github/workflows/test-mac.yml
run-test-remoteclient:
name: Run test-remoteclient
needs:
- purge-cache
- rebuild-test-caches
uses: ./.github/workflows/test-remoteclient.yml
run-test-win:
name: Run test-win
needs:
- purge-cache
- rebuild-test-caches
uses: ./.github/workflows/test-win.yml