-
Notifications
You must be signed in to change notification settings - Fork 91
141 lines (122 loc) · 4.69 KB
/
bot-cache.yml
File metadata and controls
141 lines (122 loc) · 4.69 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
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
name: bot-cache
on:
workflow_dispatch: null
schedule:
- cron: '*/15 * * * *'
concurrency: bot-cache
jobs:
bot-cache:
name: bot-cache
runs-on: "ubuntu-latest"
defaults:
run:
shell: bash -leo pipefail {0}
strategy:
max-parallel: 1
matrix:
version: [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]
steps:
- name: free disk space
uses: endersonmenezes/free-disk-space@7901478139cff6e9d44df5972fd8ab8fcade4db1 # v3
with:
remove_android: true
remove_dotnet: true
remove_haskell: true
remove_tool_cache: true
remove_swap: true
remove_packages: "azure-cli google-cloud-cli microsoft-edge-stable google-chrome-stable firefox postgresql* temurin-* *llvm* mysql* dotnet-sdk-*"
remove_packages_one_command: true
rm_cmd: "rmz"
- name: run cache
if: success() && ! env.CI_SKIP
uses: actions/cache@668228422ae6a00e4ad889ee87cd7109ec5666a7 # v5.0.4
with:
path: cf-graph.tar.zstd
key: cf-graph-tzstd-${{ github.run_id }}-${{ github.run_attempt }}-${{ matrix.version }}
restore-keys: |
cf-graph-tzstd-
- name: get latest release
id: latest_release
run: |
tag_name=$(gh api repos/regro/cf-scripts/releases/latest --jq '.tag_name')
echo "latest release: ${tag_name}"
echo "tag_name=${tag_name}" >> "$GITHUB_OUTPUT"
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
ref: ${{ steps.latest_release.outputs.tag_name }}
path: cf-scripts
- uses: mamba-org/setup-micromamba@d7c9bd84e824b79d2af72a2d4196c7f4300d3476 # v3.0.0
with:
environment-file: cf-scripts/conda-lock.yml
environment-name: cf-scripts
condarc-file: cf-scripts/autotick-bot/condarc
- name: do local setup and stop me if needed
run: |
cd cf-scripts
python autotick-bot/stop_me_if_needed.py
- name: install bot code
if: success() && ! env.CI_SKIP
run: |
source cf-scripts/autotick-bot/install_bot_code.sh --no-clone-graph
- name: run sync
if: success() && ! env.CI_SKIP
run: |
if [[ "${CF_TICK_GRAPH_DATA_BACKENDS}" != file:* ]]; then
tar -xf cf-graph.tar.zstd
cd cf-graph
conda-forge-tick sync-lazy-json-across-backends
cd ..
tar --zstd -cf cf-graph.tar.zstd cf-graph
fi
env:
CF_TICK_GRAPH_DATA_BACKENDS: "${{ vars.CF_TICK_GRAPH_DATA_BACKENDS }}"
MONGODB_CONNECTION_STRING: ${{ secrets.MONGODB_CONNECTION_STRING }}
bot-cache-trigger:
needs: bot-cache
name: bot-cache-trigger
runs-on: "ubuntu-latest"
defaults:
run:
shell: bash -leo pipefail {0}
steps:
- name: free disk space
uses: endersonmenezes/free-disk-space@7901478139cff6e9d44df5972fd8ab8fcade4db1 # v3
with:
remove_android: true
remove_dotnet: true
remove_haskell: true
rm_cmd: "rmz"
- name: get latest release
id: latest_release
run: |
tag_name=$(gh api repos/regro/cf-scripts/releases/latest --jq '.tag_name')
echo "latest release: ${tag_name}"
echo "tag_name=${tag_name}" >> "$GITHUB_OUTPUT"
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
ref: ${{ steps.latest_release.outputs.tag_name }}
path: cf-scripts
- uses: mamba-org/setup-micromamba@d7c9bd84e824b79d2af72a2d4196c7f4300d3476 # v3.0.0
with:
environment-file: cf-scripts/conda-lock.yml
environment-name: cf-scripts
condarc-file: cf-scripts/autotick-bot/condarc
- name: do local setup and stop me if needed
run: |
cd cf-scripts
python autotick-bot/stop_me_if_needed.py
- name: install bot code
if: success() && ! env.CI_SKIP
run: |
source cf-scripts/autotick-bot/install_bot_code.sh --no-clone-graph
- name: trigger next job
uses: benc-uk/workflow-dispatch@7a027648b88c2413826b6ddd6c76114894dc5ec4 # v1.3.1
if: github.ref == 'refs/heads/main' && ! cancelled() && ! failure() && ! env.CI_SKIP
with:
workflow: bot-cache
ref: ${{ github.event.ref || github.head_ref || github.ref }}
token: ${{ secrets.AUTOTICK_BOT_TOKEN }}