Skip to content

Add PR CI workflow

Add PR CI workflow #13

Workflow file for this run

name: Release
'on':
workflow_dispatch: null
pull_request: null
jobs:
pr-generate:
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/[email protected]
- uses: actions/setup-python@v5
with:
python-version: "3.13"
- run: ./download-buildifier.sh
- run: git config --global user.email "[email protected]" && git config --global user.name "Raccoons Build"
- name: Checkout BCR
uses: actions/[email protected]
with:
repository: illicitonion/bazel-central-registry
token: ${{ secrets.BCR_GITHUB_TOKEN }}
path: bazel-central-registry
ref: refs/heads/main
- run: (cd bazel-central-registry && git remote add upstream https://github.com/bazelbuild/bazel-central-registry.git && git fetch upstream && git reset --hard upstream/main)
- run: python3 generate.py --bcr_dir=$(pwd)/bazel-central-registry --overlay_tar_path=/tmp/3.3.1.bcr.wip.tar.gz --tag=3.3.1.bcr.wip --release_tar_url_template=file:///tmp/3.3.1.bcr.wip.tar.gz --buildifier=/tmp/buildifier.exe
- run: tar czf bcr.tar.gz bazel-central-registry
- name: Upload overlay
uses: actions/upload-artifact@v3
with:
name: 3.3.1.bcr.wip.tar.gz
path: /tmp/3.3.1.bcr.wip.tar.gz
if-no-files-found: error
- name: Upload bcr
uses: actions/upload-artifact@v3
with:
name: bcr.tar.gz
path: bcr.tar.gz
if-no-files-found: error
pr-test-ubuntu-latest:
needs:
- pr-generate
runs-on: ubuntu-latest
steps:
- name: Download overlay
uses: actions/download-artifact@v3
with:
name: 3.3.1.bcr.wip.tar.gz
path: /tmp/
- name: Download bcr
uses: actions/download-artifact@v3
with:
name: bcr.tar.gz
path: /tmp/
- run: tar xzf /tmp/bcr.tar.gz
- run: registry_dir="$(pwd)/bazel-central-registry" && workspace="$(mktemp -d)" && cd "${workspace}" && echo 8.0.0 > .bazelversion && echo 'bazel_dep(name = "openssl", version = "3.3.1.bcr.wip")' > MODULE.bazel && bazel test --registry="file://${registry_dir}" @openssl//...