Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tooling, Part 2 #17

Merged
merged 24 commits into from
Aug 14, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 35 additions & 4 deletions .bazelci/presubmit.yml
Original file line number Diff line number Diff line change
@@ -1,23 +1,54 @@
---
matrix:
platform:
- ubuntu2004
- macos
bazel_version: ["6.3.2", "7.0.0-pre.20230724.1"]
platform: ["centos7", "debian10", "macos", "ubuntu2004"]

validate_config: 1
buildifier: latest

tasks:
build:
include_json_profile:
- build
- test
build_targets:
- "..."
test_targets:
- "..."

kythe_ubuntu2004:
index_targets:
- "..."
index_targets_query: 'kind("java_(binary|import|library|plugin|test|proto_library) rule", ...)'
index_flags:
- "--define=kythe_corpus=github.com/sgammon/rules_graalvm"
index_upload_policy: "IfBuildSuccess"

bcr_test_module:
module_path: "example/integration_tests/bzlmod"
matrix:
platform: ["debian10", "macos", "ubuntu2004"]
platform: ["debian10", "macos", "ubuntu2004", "centos7"]
tasks:
build_bzlmod_test:
name: "Build test module"
platform: ${{ platform }}
build_targets:
- "//..."
---
bazel: 5.4.0

matrix:
platform: ["centos7", "debian10", "macos", "ubuntu2004"]

tasks:
build:
include_json_profile:
- build
- test
shell_commands:
- echo "5.4.0" > .bazelversion
- echo "import %workspace%/tools/bazel/bazel5.bazelrc" > version.bazelrc
build_targets:
- "..."
test_targets:
- "..."
3 changes: 1 addition & 2 deletions .bazelrc
Original file line number Diff line number Diff line change
@@ -1,15 +1,13 @@
common:verbose --announce_rc

# Import Aspect bazelrc presets
import %workspace%/.aspect/bazelrc/bazel7.bazelrc
import %workspace%/.aspect/bazelrc/convenience.bazelrc
import %workspace%/.aspect/bazelrc/correctness.bazelrc
import %workspace%/.aspect/bazelrc/debug.bazelrc
import %workspace%/.aspect/bazelrc/performance.bazelrc

# Import project-level presets
import %workspace%/tools/bazel/base.bazelrc
import %workspace%/tools/bazel/bazel7.bazelrc
import %workspace%/tools/bazel/buildbuddy.bazelrc
import %workspace%/tools/bazel/cache.bazelrc
import %workspace%/tools/bazel/ci.bazelrc
Expand All @@ -27,3 +25,4 @@ build --verbose_failures
common:noop --logging=3

try-import %workspace%/local.bazelrc
try-import %workspace%/version.bazelrc
18 changes: 18 additions & 0 deletions .github/renovate.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
"extends": ["config:base"],
"enabledManagers": ["bazel", "git-submodules", "npm", "bazelisk"],
"baseBranches": ["main"],
"pinDigests": true,
"rangeStrategy": "pin",
"updateLockFiles": true,
"dependencyDashboard": true,
"dependencyDashboardApproval": true,
"lockFileMaintenance": { "enabled": true },
"labels": ["dependencies"],
"encrypted": {
"BUILDLESS_APIKEY": "wcFMA/xDdHCJBTolAQ//ZlxBi4WHvXzRIihVCeYomsCrSSPjKrHR0cuX8aDQENaGwIHyNmuyziCIHky3j/xoflJaFalDQkFzWcjPl35SroRZl/I8+T3wtR8jTutKF3MouJkMM7oaXkWk50/putF9ubb32tcdpRSbOzzpxIhPhxb5EyjqttaxgjQ553r4zBsLPZVSGxnCQ2PYbbAw3DA7MGq3mh5P7kityopLEOGeLfHJxQSNQ7CslJyX8rNGZINOjDOpZ31Q88n4jyGfzfuVcHRYWw03+7vjJls+MePhxTe7qK2IwkADEsRaGurH6a236hHTjuOVmsMN5r7KKAgauZ2umSRMn/5Nu6o8ZelVKMZ5R1Sa+4mLHA/EvTn33DGCGAmI/khScu/jktn6faKT7psbMd8CBUlHcmfhdMlfuuHassYaPf+LRjyBON+c0lfMgoQdYeD4d1EF/HlnDy0LIqYHgkWHz1wBgOVaBXc+vSFZ7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B0CJvQuShK2CNkWD/4v6N9Ec0zlslSEcEAz9QdaW+UdIcbYTkdRzt"
}
}
2 changes: 1 addition & 1 deletion .github/workflows/bazel.ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@ jobs:
[
"."
]
exclude_windows: true
exclude: |
[
{"bazelversion": "5.4.0", "bzlmodEnabled": true},
{"bazelversion": "5.4.0", "bzlmodEnabled": false},
{"bazelversion": "5.4.0", "os": "macos-latest"},
{"bazelversion": "5.4.0", "os": "windows-latest"}
]
14 changes: 14 additions & 0 deletions .github/workflows/check.buildifier.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,22 @@ name: Buildifier
# Triggers the workflow on push or pull request events but only for the main branch
push:
branches: [main]
paths:
- docs/**/*.*
- example/**/*.*
- graalvm/**/*.*
- internal/**/*.*
- tools/**/*.*

pull_request:
branches: [main]
paths:
- docs/**/*.*
- example/**/*.*
- graalvm/**/*.*
- internal/**/*.*
- tools/**/*.*

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

Expand Down
12 changes: 12 additions & 0 deletions .github/workflows/check.codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,20 @@ name: "CodeQL"
"on":
push:
branches: ["main"]
paths:
- docs/**/*.*
- example/**/*.*
- graalvm/**/*.*
- internal/**/*.*
- tools/**/*.*
pull_request:
branches: ["main"]
paths:
- docs/**/*.*
- example/**/*.*
- graalvm/**/*.*
- internal/**/*.*
- tools/**/*.*
schedule:
- cron: "0 0 * * 1"

Expand Down
102 changes: 95 additions & 7 deletions .github/workflows/module.build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,25 @@ name: "Build"
description: "Enable Bzlmod"
type: boolean
default: false

## Whether to run tests
tests:
description: "Run Tests"
type: boolean
default: true

## Bazel version to use
bazel_version:
description: "Bazel version"
type: string
default: "7.0.0-pre.20230724.1"

## Configuration profile to use
bazel_config:
description: "Bazel profile"
type: string
default: "bazel7"

workflow_call:
inputs:
runner:
Expand All @@ -29,19 +48,38 @@ name: "Build"
description: "Enable Bzlmod"
type: boolean
default: false
tests:
description: "Run Tests"
type: boolean
default: true
labs:
description: "Skip Failures"
type: boolean
default: false
bazel_version:
description: "Bazel version"
type: string
default: "7.0.0-pre.20230724.1"
bazel_config:
description: "Bazel profile"
type: string
default: "bazel7"
secrets:
## Secrets: BuildBuddy API key
BUILDBUDDY_APIKEY:
required: true
required: false

## Secrets: Buildless API key
BUILDLESS_APIKEY:
required: true
required: false

env:
BUILDLESS_APIKEY: ${{ secrets.BUILDLESS_APIKEY }}
BUILDBUDDY_APIKEY: ${{ secrets.BUILDBUDDY_APIKEY }}

jobs:
build:
name: "Build: ${{ inputs.label || 'Rules' }}"
name: "Build"
runs-on: ${{ inputs.runner || 'ubuntu-latest' }}
continue-on-error: ${{ inputs.labs }}
steps:
Expand All @@ -61,16 +99,66 @@ jobs:
with:
path: "~/.cache/bazel"
key: bazel-v2
- name: "Configure: Bazel"
- name: "Configure: Bazel Services"
shell: bash
if: contains(env.BUILDLESS_APIKEY || '', 'user_')
run: |
echo "build --remote_header=x-buildbuddy-api-key=${{ secrets.BUILDBUDDY_APIKEY }}" >> local.bazelrc
echo "build --remote_header=x-api-key=${{ secrets.BUILDLESS_APIKEY }}" >> local.bazelrc
- name: "Configure: Bzlmod"
if: ${{ inputs.bzlmod }}
if: inputs.bzlmod
run: |
echo "build --config=bzlmod" >> local.bazelrc
- name: "Build: Example"
- name: "Build: Project"
continue-on-error: ${{ inputs.labs }}
shell: bash
run: bazel build --config=ci "//example/native"

integration-tests:
name: "Test: ${{ matrix.label }}"
runs-on: ${{ inputs.runner || 'ubuntu-latest' }}
continue-on-error: ${{ inputs.labs || matrix.labs }}
needs: ["build"]
if: inputs.tests && (inputs.bazel_config == 'bazel7' || inputs.bazel_config == 'bazel6')
strategy:
fail-fast: false
matrix:
label: ["BCR"]
target: ["sample"]
action: ["build"]
directory: ["./example/integration_tests/bzlmod"]
labs: [false]
steps:
- name: Harden Runner
uses: step-security/harden-runner@8ca2b8b2ece13480cda6dacd3511b49857a23c09 # v2.5.1
with:
egress-policy: audit
- name: "Setup: Checkout"
uses: actions/checkout@v3
- name: "Setup: msbuild"
uses: microsoft/setup-msbuild@v1.1
if: ${{ contains(inputs.runner, 'windows') }}
- name: "Setup: Bazel"
uses: bazelbuild/setup-bazelisk@v2
- name: "Setup: Cache"
uses: actions/cache@v3
with:
path: "~/.cache/bazel"
key: bazel-v2
- name: "Configure: Bazel Version"
shell: bash
if: inputs.bazel_version != '' && inputs.bazel_config != ''
run: |
echo "${{ inputs.bazel_version }}" > .bazelversion
echo "import %workspace%/tools/bazel/${{ inputs.bazel_config }}.bazelrc" > version.bazelrc
- name: "Configure: Bazel Services"
shell: bash
if: contains(env.BUILDLESS_APIKEY || '', 'user_')
run: |
echo "build --remote_header=x-buildbuddy-api-key=${{ secrets.BUILDBUDDY_APIKEY }}" >> local.bazelrc
echo "build --remote_header=x-api-key=${{ secrets.BUILDLESS_APIKEY }}" >> local.bazelrc
- name: "Test: ${{ matrix.label }}"
continue-on-error: ${{ inputs.labs }}
working-directory: ${{ matrix.directory }}
shell: bash
run: bazel build --config=ci "//..."
run: bazel ${{ matrix.action || 'build' }} "${{ matrix.target || '//...' }}"
Loading
Loading