Skip to content

Update dependencies #73

Update dependencies

Update dependencies #73

name: Update dependencies
on:
workflow_dispatch:
schedule:
# * is a special character in YAML so you have to quote this string
- cron: '30 1 * * Mon,Wed,Fri'
jobs:
update:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v4
- name: "πŸ”§ Setup runner"
uses: ./.github/workflows/manage-runner-pre
########################################
# Once per night, update dependencies and completely delete and recreate bazel cache
########################################
- name: "🐍 Setup Python"
uses: actions/setup-python@v5
with:
python-version: "3.11"
- name: "🐍 Install Poetry"
uses: snok/install-poetry@v1
- name: "βš’οΈ Completely delete bazel cache and then recreate it"
run: |
set -eExou pipefail
#
# Update dependencies and export files that bazel can consume
#
git fetch
git reset --hard origin/main
cargo upgrade --exclude opentelemetry --recursive
poetry update
CARGO_BAZEL_REPIN=true bazel query >/dev/null
./bin/poetry.sh
#
# Completely delete the bazel cache and then recreate it
# Cache should have everything that bazel build requires, and nothing more
#
sudo rm -rf ~/.cache/bazel/*
CARGO_BAZEL_REPIN=true bazel build ...
bazel test
- name: "πŸ†• Create a new Pull Request with the changes"
uses: peter-evans/create-pull-request@v6
with:
commit-message: "chore: Update dependencies"
branch: bot-update-deps
title: "chore: Update dependencies"
body: "This PR updates poetry (Python) and cargo (Rust) dependencies and recreates the bazel cache."
token: ${{ secrets.GIX_CREATE_PR_PAT }}
- name: "πŸͺ“ Tear down runner"
uses: ./.github/workflows/manage-runner-post