Skip to content

Commit bec1a5a

Browse files
committed
Auto gen updates
1 parent 672abc2 commit bec1a5a

31 files changed

+327
-489
lines changed

.bazelignore

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
tests
2-
generate
2+
generate

.bazelrc

+5-1
Original file line numberDiff line numberDiff line change
@@ -17,28 +17,32 @@ build:roborio --copt=-std=c++20
1717
build:roborio --platforms=@rules_bzlmodrio_toolchains//platforms/roborio
1818
build:roborio --build_tag_filters=-no-roborio
1919
build:roborio --features=compiler_param_file
20+
build:roborio --platform_suffix=roborio
2021

2122
# bullseye32
2223
build:bullseye32 --copt=-std=c++20
2324
build:bullseye32 --platforms=@rules_bzlmodrio_toolchains//platforms/bullseye32
2425
build:bullseye32 --build_tag_filters=-no-bullseye
2526
build:bullseye32 --features=compiler_param_file
27+
build:bullseye32 --platform_suffix=bullseye32
2628

2729
# bullseye64
2830
build:bullseye64 --copt=-std=c++20
2931
build:bullseye64 --platforms=@rules_bzlmodrio_toolchains//platforms/bullseye64
3032
build:bullseye64 --build_tag_filters=-no-bullseye
3133
build:bullseye64 --features=compiler_param_file
34+
build:bullseye64 --platform_suffix=bullseye64
3235

3336
# rasppi
3437
build:raspi32 --copt=-std=c++20
3538
build:raspi32 --platforms=@rules_bzlmodrio_toolchains//platforms/raspi32
3639
build:raspi32 --build_tag_filters=-no-raspi
3740
build:raspi32 --features=compiler_param_file
41+
build:raspi32 --platform_suffix=raspi32
3842

3943
# Global
4044
import .bazelrc-buildbuddy
4145
test --test_output=errors
4246
build --incompatible_enable_cc_toolchain_resolution
4347
build --java_language_version=11
44-
build --registry=https://raw.githubusercontent.com/pjreiniger/bazel-central-registry/megadiff/
48+
build --registry=https://raw.githubusercontent.com/pjreiniger/bazel-central-registry/bzlmodrio/

.bazelrc-buildbuddy

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,4 @@ build:remote --remote_timeout=3600
77
build --experimental_inmemory_jdeps_files
88
build --experimental_inmemory_dotd_files
99

10-
build:ci --build_metadata=ROLE=CI
10+
build:ci --build_metadata=ROLE=CI

.bazelversion

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
6.0.0

.github/workflows/auto_update.yml

+82
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
name: Auto Update
2+
on:
3+
push:
4+
branches-ignore:
5+
- 'autoupdate'
6+
7+
concurrency:
8+
group: ${{ github.workflow }}-${{ github.head_ref || github.ref }}
9+
cancel-in-progress: true
10+
11+
jobs:
12+
auto_update_module:
13+
name: "Auto Update Module"
14+
runs-on: ubuntu-latest
15+
steps:
16+
- name: Set up Go 1.15.x
17+
uses: actions/setup-go@v2
18+
with:
19+
go-version: 1.15.x
20+
id: go
21+
22+
- uses: actions/checkout@v3
23+
24+
- name: Install Buildifier
25+
run: |
26+
cd $(mktemp -d)
27+
GO111MODULE=on go get github.com/bazelbuild/buildtools/[email protected]
28+
29+
# Checkout repository
30+
- uses: actions/checkout@v3
31+
with:
32+
path: libraries/bzlmodrio-opencv
33+
34+
# Checkout gentool
35+
- uses: actions/checkout@v3
36+
with:
37+
repository: 'bzlmodRio/gentool.git'
38+
fetch-depth: 0
39+
path: gentool
40+
ref: refactor_dev
41+
42+
43+
44+
- name: Setup Cache
45+
uses: actions/cache@v3
46+
with:
47+
path: |
48+
~/bzlmod_cache/*.sha256
49+
key: ${{ runner.os }}-${{ hashFiles('**/generate/**') }}
50+
restore-keys: |
51+
${{ runner.os }}-
52+
${{ runner.os }}
53+
54+
# Run update
55+
- name: Run update
56+
run: bazel run //:auto_update
57+
working-directory: libraries/bzlmodrio-opencv/generate
58+
59+
- name: Generate if changed
60+
run: |
61+
if [[ $(git --no-pager diff --exit-code HEAD) != '' ]]; then
62+
echo "Something changed, need to re-generate"
63+
bazel run //:generate
64+
buildifier --lint=fix -r ..
65+
else
66+
echo "No changes!"
67+
fi;
68+
working-directory: libraries/bzlmodrio-opencv/generate
69+
70+
71+
# Create pull requests
72+
- name: Create Pull Request
73+
uses: peter-evans/create-pull-request@v4
74+
env:
75+
GITHUB_TOKEN: ${{ secrets.AUTO_UPDATE_KEY }}
76+
with:
77+
path: libraries/bzlmodrio-opencv
78+
base: refactor_dev
79+
token: ${{ secrets.AUTO_UPDATE_KEY }}
80+
reviewers: pjreiniger
81+
branch: autoupdate
82+
title: "Auto-update"

.github/workflows/build.yml

+24-6
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
name: Build example project
22
on: [pull_request, push]
3+
4+
concurrency:
5+
group: ${{ github.workflow }}-${{ github.head_ref || github.ref }}
6+
cancel-in-progress: true
7+
38
jobs:
49
build_native:
510
strategy:
@@ -20,12 +25,13 @@ jobs:
2025
runs-on: ${{ matrix.os }}
2126
steps:
2227
- uses: actions/checkout@v3
23-
- run: bazel ${{ matrix.bazel_options }} build -k ${{ matrix.config }} --verbose_failures --config=remote //... @bzlmodrio-opencv//...
28+
- uses: actions/setup-python@v4
29+
- run: bazel ${{ matrix.bazel_options }} build -k ${{ matrix.config }} --verbose_failures --config=remote //... @bzlmodrio-opencv//... || true
2430
working-directory: tests
2531
- run: bazel ${{ matrix.bazel_options }} ${{ matrix.command }} //... -k ${{ matrix.config }} --verbose_failures --config=remote
2632
working-directory: tests
2733

28-
34+
2935
build_roborio:
3036
strategy:
3137
fail-fast: false
@@ -35,7 +41,7 @@ jobs:
3541
- { name: "windows - roborio", os: windows-latest, command: "build", config: "--config=roborio", bazel_options: "--output_user_root=C:\\bazelroot", }
3642
- { name: "ubuntu - roborio", os: ubuntu-latest, command: "build", config: "--config=roborio", bazel_options: "", }
3743
- { name: "macos - roborio", os: macos-latest, command: "build", config: "--config=roborio", bazel_options: "", }
38-
44+
3945
# Build bzlmod, roborio
4046
# - { name: "windows - bzlmod roborio", os: windows-latest, command: "build", config: "--enable_bzlmod --config=roborio", bazel_options: "--output_user_root=C:\\bazelroot", }
4147
- { name: "ubuntu - bzlmod roborio", os: ubuntu-latest, command: "build", config: "--enable_bzlmod --config=roborio", bazel_options: "", }
@@ -44,6 +50,10 @@ jobs:
4450
runs-on: ${{ matrix.os }}
4551
steps:
4652
- uses: actions/checkout@v3
53+
- uses: actions/setup-python@v4
54+
- name: Build and allow failure # TODO Sometimes symlinks don't get created correctly the first time around
55+
run: bazel ${{ matrix.bazel_options }} ${{ matrix.command }} //... -k ${{ matrix.config }} --verbose_failures --config=remote || true
56+
working-directory: tests
4757
- run: bazel ${{ matrix.bazel_options }} ${{ matrix.command }} //... -k ${{ matrix.config }} --verbose_failures --config=remote
4858
working-directory: tests
4959

@@ -56,7 +66,7 @@ jobs:
5666
- { name: "windows - bullseye32", os: windows-latest, command: "build", config: "--config=bullseye32", bazel_options: "--output_user_root=C:\\bazelroot", }
5767
- { name: "ubuntu - bullseye32", os: ubuntu-latest, command: "build", config: "--config=bullseye32", bazel_options: "", }
5868
# - { name: "macos - bullseye32", os: macos-latest, command: "build", config: "--config=bullseye32", bazel_options: "", }
59-
69+
6070
# Build bzlmod, bullseye32
6171
# - { name: "windows - bzlmod bullseye32", os: windows-latest, command: "build", config: "--enable_bzlmod --config=bullseye32", bazel_options: "--output_user_root=C:\\bazelroot", }
6272
- { name: "ubuntu - bzlmod bullseye32", os: ubuntu-latest, command: "build", config: "--enable_bzlmod --config=bullseye32", bazel_options: "", }
@@ -65,6 +75,10 @@ jobs:
6575
runs-on: ${{ matrix.os }}
6676
steps:
6777
- uses: actions/checkout@v3
78+
- uses: actions/setup-python@v4
79+
- name: Build and allow failure # TODO Sometimes symlinks don't get created correctly the first time around
80+
run: bazel ${{ matrix.bazel_options }} ${{ matrix.command }} //... -k ${{ matrix.config }} --verbose_failures --config=remote || true
81+
working-directory: tests
6882
- run: bazel ${{ matrix.bazel_options }} ${{ matrix.command }} //... -k ${{ matrix.config }} --verbose_failures --config=remote
6983
working-directory: tests
7084

@@ -78,7 +92,7 @@ jobs:
7892
- { name: "windows - bullseye64", os: windows-latest, command: "build", config: "--config=bullseye64", bazel_options: "--output_user_root=C:\\bazelroot", }
7993
- { name: "ubuntu - bullseye64", os: ubuntu-latest, command: "build", config: "--config=bullseye64", bazel_options: "", }
8094
# - { name: "macos - bullseye64", os: macos-latest, command: "build", config: "--config=bullseye32", bazel_options: "", }
81-
95+
8296
# Build bzlmod, bullseye32:
8397
# - { name: "windows - bzlmod bullseye64", os: windows-latest, command: "build", config: "--enable_bzlmod --config=bullseye64", bazel_options: "--output_user_root=C:\\bazelroot", }
8498
- { name: "ubuntu - bzlmod bullseye64", os: ubuntu-latest, command: "build", config: "--enable_bzlmod --config=bullseye64", bazel_options: "", }
@@ -87,5 +101,9 @@ jobs:
87101
runs-on: ${{ matrix.os }}
88102
steps:
89103
- uses: actions/checkout@v3
104+
- uses: actions/setup-python@v4
105+
- name: Build and allow failure # TODO Sometimes symlinks don't get created correctly the first time around
106+
run: bazel ${{ matrix.bazel_options }} ${{ matrix.command }} //... -k ${{ matrix.config }} --verbose_failures --config=remote || true
107+
working-directory: tests
90108
- run: bazel ${{ matrix.bazel_options }} ${{ matrix.command }} //... -k ${{ matrix.config }} --verbose_failures --config=remote
91-
working-directory: tests
109+
working-directory: tests

.github/workflows/lint.yml

+26-1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,31 @@ jobs:
99
- uses: actions/checkout@v2
1010
- uses: psf/black@stable
1111
wpiformat:
12+
name: "wpiformat"
13+
runs-on: ubuntu-latest
14+
steps:
15+
- uses: actions/checkout@v3
16+
- name: Fetch main
17+
run: |
18+
git fetch origin main
19+
git branch -f main origin/main
20+
if: github.ref != 'refs/heads/main'
21+
- uses: actions/setup-python@v2
22+
with:
23+
python-version: '3.10.8'
24+
- name: Install clang-format
25+
run: |
26+
wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add -
27+
sudo sh -c "echo 'deb http://apt.llvm.org/jammy/ llvm-toolchain-jammy-14 main' >> /etc/apt/sources.list.d/proposed-repositories.list"
28+
sudo apt-get update -q
29+
sudo apt-get install -y clang-format-14
30+
- run: bazel run @rules_wpiformat//wpiformat -- -f ..
31+
working-directory: tests
32+
if: github.ref != 'refs/heads/main'
33+
34+
- name: Check Output
35+
run: git --no-pager diff --exit-code HEAD
36+
buildifier:
1237
name: "buildifier"
1338
runs-on: ubuntu-latest
1439
steps:
@@ -39,4 +64,4 @@ jobs:
3964
with:
4065
name: buildifier fixes
4166
path: buildifier-fixes.patch
42-
if: ${{ failure() }}
67+
if: ${{ failure() }}

.github/workflows/publish.yml

+79
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
name: Publish Module
2+
on:
3+
workflow_dispatch:
4+
push:
5+
tags:
6+
- '*'
7+
8+
concurrency:
9+
group: ${{ github.workflow }}-${{ github.head_ref || github.ref }}
10+
cancel-in-progress: true
11+
12+
jobs:
13+
publish_module:
14+
name: "Publish Module"
15+
runs-on: ubuntu-latest
16+
steps:
17+
# Checkout repository
18+
- uses: actions/checkout@v3
19+
with:
20+
path: libraries/bzlmodrio-opencv
21+
22+
- name: Create Archive
23+
run: git archive HEAD --format=tar.gz --output="bzlmodrio-opencv-${GITHUB_REF_NAME}.tar.gz"
24+
working-directory: libraries/bzlmodrio-opencv
25+
26+
- name: Setup archive name
27+
run: echo "ARCHIVE_NAME=libraries/bzlmodrio-opencv/bzlmodrio-opencv-${GITHUB_REF_NAME}.tar.gz" >> "$GITHUB_ENV"
28+
29+
- name: Release
30+
uses: softprops/action-gh-release@v1
31+
if: startsWith(github.ref, 'refs/tags/')
32+
with:
33+
files: "${{ env.ARCHIVE_NAME }}"
34+
35+
36+
# Checkout gentool
37+
- uses: actions/checkout@v3
38+
with:
39+
repository: 'bzlmodRio/gentool.git'
40+
fetch-depth: 0
41+
path: gentool
42+
ref: refactor_dev
43+
44+
# Checkout BCR
45+
- uses: actions/checkout@v3
46+
with:
47+
repository: 'bzlmodRio/bazel-central-registry.git'
48+
fetch-depth: 0
49+
path: bazel-central-registry
50+
ref: bzlmodrio
51+
52+
# Run publishing
53+
- run: bazel run //:publish
54+
working-directory: libraries/bzlmodrio-opencv/generate
55+
56+
# Create pull requests
57+
- name: Create Gentool Pull Request
58+
uses: peter-evans/create-pull-request@v4
59+
env:
60+
GITHUB_TOKEN: ${{ secrets.AUTO_UPDATE_KEY }}
61+
with:
62+
path: gentool
63+
base: refactor_dev
64+
token: ${{ secrets.AUTO_UPDATE_KEY }}
65+
reviewers: pjreiniger
66+
branch: autoupdate/bzlmodrio-opencv_update
67+
title: "Auto-update latest bzlmodrio-opencv module release"
68+
69+
- name: Create BCR Pull Request
70+
uses: peter-evans/create-pull-request@v4
71+
env:
72+
GITHUB_TOKEN: ${{ secrets.AUTO_UPDATE_KEY }}
73+
with:
74+
path: bazel-central-registry
75+
base: bzlmodrio
76+
token: ${{ secrets.AUTO_UPDATE_KEY }}
77+
reviewers: pjreiniger
78+
branch: autoupdate/rules_wpi_styleguid_update
79+
title: "Auto-update latest bzlmodrio-opencv module release"

tests/.styleguide .styleguide

File renamed without changes.
File renamed without changes.

MODULE.bazel

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
module(
22
name = "bzlmodrio-opencv",
3-
version = "4.6.0-4-1",
3+
version = "4.6.0-4",
44
compatibility_level = 2023,
55
)
66

77
bazel_dep(name = "platforms", version = "0.0.6")
88
bazel_dep(name = "rules_java", version = "5.4.0")
9-
bazel_dep(name = "rules_bazelrio", version = "0.0.9")
9+
bazel_dep(name = "rules_bazelrio", version = "0.0.10")
1010
bazel_dep(name = "rules_bzlmodrio_toolchains", version = "2023-7")
1111

1212
setup_bzlmodrio_opencv_cpp_dependencies = use_extension("//:maven_cpp_deps.bzl", "setup_bzlmodrio_opencv_cpp_dependencies")

README.md

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+

WORKSPACE.bzlmod

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+

generate/BUILD.bazel

+9
Original file line numberDiff line numberDiff line change
@@ -24,3 +24,12 @@ py_binary(
2424
"@bzlmodrio-gentool//bazelrio_gentool",
2525
],
2626
)
27+
28+
py_binary(
29+
name = "auto_update",
30+
srcs = ["auto_update.py"],
31+
deps = [
32+
":generate",
33+
"@bzlmodrio-gentool//bazelrio_gentool",
34+
],
35+
)

generate/WORKSPACE

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ http_archive(
1212

1313
local_repository(
1414
name = "bzlmodrio-gentool",
15-
path = "../../gentool",
15+
path = "../../../gentool",
1616
)
1717

1818
load("@rules_python//python:pip.bzl", "pip_parse")

0 commit comments

Comments
 (0)