Update dependencies #73
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: 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 |