bot-cache #6089
This file contains 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: 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: run cache | |
if: success() && ! env.CI_SKIP | |
uses: actions/cache@6849a6489940f00c2f30c0fb92c6274307ccb58a # v4 | |
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@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 | |
with: | |
ref: ${{ steps.latest_release.outputs.tag_name }} | |
path: cf-scripts | |
- uses: mamba-org/setup-micromamba@06375d89d211a1232ef63355742e9e2e564bc7f7 # v1 | |
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: 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@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 | |
with: | |
ref: ${{ steps.latest_release.outputs.tag_name }} | |
path: cf-scripts | |
- uses: mamba-org/setup-micromamba@06375d89d211a1232ef63355742e9e2e564bc7f7 # v1 | |
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@e2e5e9a103e331dad343f381a29e654aea3cf8fc # v1.2.4 | |
if: github.ref == 'refs/heads/main' && ! cancelled() && ! failure() && ! env.CI_SKIP | |
with: | |
workflow: bot-cache | |
ref: ${{ github.event.ref }} | |
token: ${{ secrets.AUTOTICK_BOT_TOKEN }} |