Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion .bazelversion
Original file line number Diff line number Diff line change
@@ -1 +1 @@
last_rc
8.4.2
10 changes: 5 additions & 5 deletions .github/workflows/examples.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ on:
- bump-rbe
pull_request:
jobs:
examples-basic:
runs-on: ubuntu-20.04
examples-umbrella:
runs-on: ubuntu-24.04
strategy:
fail-fast: false
matrix:
Expand All @@ -23,19 +23,19 @@ jobs:
with:
otp-version: ${{ matrix.otp }}
- name: TEST
working-directory: examples/basic
working-directory: examples/umbrella
run: |
bazelisk test //... \
--color=yes
- name: RESOVLE TEST LOGS PATH
if: always()
working-directory: examples/basic
working-directory: examples/umbrella
run: |
echo "LOGS_PATH=$(readlink -f bazel-testlogs)" >> $GITHUB_OUTPUT
id: resolve-test-logs-path
- name: CAPTURE TEST LOGS
if: always()
uses: actions/upload-artifact@v4
with:
name: bazel-testlogs-examples-basic-${{matrix.otp}}
name: bazel-testlogs-examples-umbrella-${{matrix.otp}}
path: ${{ steps.resolve-test-logs-path.outputs.LOGS_PATH }}/*
191 changes: 36 additions & 155 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,34 +3,11 @@ on:
push:
branches:
- main
- 3.15.x
- 3.16.x
- bump-rbe
- develop
pull_request:
jobs:
unit-test:
runs-on: ubuntu-20.04
strategy:
fail-fast: false
matrix:
otp:
- "25.3"
- "26.2"
steps:
- name: CHECKOUT
uses: actions/checkout@v4
- name: CONFIGURE ERLANG
uses: erlef/setup-beam@v1
with:
otp-version: ${{ matrix.otp }}
- name: UNIT TEST
run: |
ERLANG_HOME="$(dirname $(dirname $(which erl)))"
bazelisk test //... \
--noenable_bzlmod \
--color=yes
unit-test-bzlmod:
runs-on: ubuntu-20.04
runs-on: ubuntu-24.04
strategy:
fail-fast: false
matrix:
Expand All @@ -39,52 +16,18 @@ jobs:
- "26.2"
steps:
- name: CHECKOUT
uses: actions/checkout@v4
uses: actions/checkout@v7
- name: CONFIGURE ERLANG
uses: erlef/setup-beam@v1
with:
otp-version: ${{ matrix.otp }}
- name: UNIT TEST
run: |
ERLANG_HOME="$(dirname $(dirname $(which erl)))"
bazelisk test //... \
bazelisk build //... \
--color=yes
test:
runs-on: ubuntu-20.04
strategy:
fail-fast: false
matrix:
otp:
- "25.3"
- "26.2"
steps:
- name: CHECKOUT
uses: actions/checkout@v4
- name: CONFIGURE ERLANG
uses: erlef/setup-beam@v1
with:
otp-version: ${{ matrix.otp }}
- name: TEST
working-directory: test
run: |
ERLANG_HOME="$(dirname $(dirname $(which erl)))"
bazelisk test //... \
--noenable_bzlmod \
--color=yes
- name: RESOVLE TEST LOGS PATH
if: always()
working-directory: test
run: |
echo "LOGS_PATH=$(readlink -f bazel-testlogs)" >> $GITHUB_OUTPUT
id: resolve-test-logs-path
- name: CAPTURE TEST LOGS
if: always()
uses: actions/upload-artifact@v4
with:
name: bazel-testlogs-${{matrix.otp}}
path: ${{ steps.resolve-test-logs-path.outputs.LOGS_PATH }}/*
test-bzlmod:
runs-on: ubuntu-20.04
runs-on: ubuntu-24.04
strategy:
fail-fast: false
matrix:
Expand All @@ -93,7 +36,7 @@ jobs:
- "26.2"
steps:
- name: CHECKOUT
uses: actions/checkout@v4
uses: actions/checkout@v7
- name: CONFIGURE ERLANG
uses: erlef/setup-beam@v1
with:
Expand All @@ -111,15 +54,15 @@ jobs:
id: resolve-test-logs-path
- name: CAPTURE TEST LOGS
if: always()
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@v7
with:
name: bazel-testlogs-bzlmod-${{matrix.otp}}
path: ${{ steps.resolve-test-logs-path.outputs.LOGS_PATH }}/*
test-bzlmod-macos:
runs-on: macos-latest
runs-on: macos-15
steps:
- name: CHECKOUT
uses: actions/checkout@v4
uses: actions/checkout@v7
- name: CONFIGURE ERLANG
run: |
brew install erlang
Expand All @@ -137,66 +80,40 @@ jobs:
id: resolve-test-logs-path
- name: CAPTURE TEST LOGS
if: always()
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@v7
with:
name: bazel-testlogs-bzlmod-macos
path: ${{ steps.resolve-test-logs-path.outputs.LOGS_PATH }}/*
test-bzlmod-windows:
runs-on: windows-latest
strategy:
fail-fast: false
matrix:
otp:
- "25.3"
check-buildbuddy-secret:
runs-on: ubuntu-24.04
outputs:
has-key: ${{ steps.check.outputs.has-key }}
steps:
- name: CHECKOUT
uses: actions/checkout@v4
- name: CONFIGURE ERLANG
uses: erlef/setup-beam@v1
with:
otp-version: ${{ matrix.otp }}
- name: CONFIGURE BAZEL
working-directory: test
shell: bash
run: |
cat << EOF >> user.bazelrc
startup --output_user_root=C:/tmp
startup --windows_enable_symlinks
build --enable_runfiles
build --color=yes
build --@rules_erlang//:ct_test_windows_logdir_drive_letter=z
build --jobs=1
EOF
- name: TEST
working-directory: test
shell: cmd
run: |
bazelisk test //...
- name: RESOVLE TEST LOGS PATH
if: always()
working-directory: test
shell: bash
run: |
LOGS_TAR=$PWD/logs.tar
cd bazel-testlogs
tar -cf $LOGS_TAR *
- name: CAPTURE TEST LOGS
if: always()
uses: actions/upload-artifact@v4
with:
name: bazel-testlogs-bzlmod-windows-${{matrix.otp}}
path: test/logs.tar
- id: check
env:
BUILDBUDDY_API_KEY: ${{ secrets.BUILDBUDDY_API_KEY }}
run: |
if [ -n "$BUILDBUDDY_API_KEY" ]; then
echo "has-key=true" >> $GITHUB_OUTPUT
else
echo "has-key=false" >> $GITHUB_OUTPUT
fi
test-bzlmod-internal-erlang:
runs-on: ubuntu-20.04
runs-on: ubuntu-24.04
needs: check-buildbuddy-secret
if: needs.check-buildbuddy-secret.outputs.has-key == 'true'
steps:
- name: CHECKOUT
uses: actions/checkout@v4
uses: actions/checkout@v7
- name: CONFIGURE BAZEL
working-directory: test
env:
BUILDBUDDY_API_KEY: ${{ secrets.BUILDBUDDY_API_KEY }}
run: |
cat << EOF >> user.bazelrc
build:buildbuddy --remote_download_minimal
build:buildbuddy --color=yes
build:buildbuddy --remote_header=x-buildbuddy-api-key=$BUILDBUDDY_API_KEY
EOF
- name: BUILD
working-directory: test
Expand All @@ -221,15 +138,15 @@ jobs:
id: resolve-test-logs-path
- name: CAPTURE TEST LOGS
if: always()
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@v7
with:
name: bazel-testlogs-bzlmod-internal-erlang
path: ${{ steps.resolve-test-logs-path.outputs.LOGS_PATH }}/*
test-bzlmod-coverage:
runs-on: ubuntu-20.04
runs-on: ubuntu-24.04
steps:
- name: CHECKOUT
uses: actions/checkout@v4
uses: actions/checkout@v7
# - name: INSTALL LCOV
# run: |
# sudo apt-get install -y lcov
Expand All @@ -254,58 +171,22 @@ jobs:
id: resolve-test-logs-path
- name: CAPTURE TEST LOGS
if: always()
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@v7
with:
name: bazel-testlogs-bzlmod-coverage
path: ${{ steps.resolve-test-logs-path.outputs.LOGS_PATH }}/*
test-host-erlang-change-detected:
runs-on: ubuntu-20.04
steps:
- name: CHECKOUT
uses: actions/checkout@v4
- name: CONFIGURE ERLANG
uses: erlef/setup-beam@v1
with:
otp-version: "25.0"
- name: BUILD
working-directory: test
id: before
run: |
bazelisk build :otp_version \
--color=yes
echo "otp=$(cat bazel-bin/otp_version.txt)" >> $GITHUB_OUTPUT
- name: CONFIGURE ERLANG
uses: erlef/setup-beam@v1
with:
otp-version: "24.3"
- name: BUILD
working-directory: test
id: after
run: |
bazelisk build :otp_version \
--color=yes
echo "otp=$(cat bazel-bin/otp_version.txt)" >> $GITHUB_OUTPUT
- name: CHECK
run: |
set -x
if [[ "${{ steps.before.outputs.otp }}" == "${{ steps.after.outputs.otp }}" ]]; then
echo "Fail"
fi
summary:
needs:
- unit-test
- unit-test-bzlmod
- test
- test-bzlmod
- test-bzlmod-macos
- test-bzlmod-windows
- test-bzlmod-internal-erlang
- test-bzlmod-coverage
- test-host-erlang-change-detected
if: ${{ !cancelled() }}
runs-on: ubuntu-latest
steps:
- name: SUMMARY
run: |
cat << 'EOF' | jq -e 'map(.result == "success") | all(.)'
cat << 'EOF' | jq -e 'map(.result == "success" or .result == "skipped") | all(.)'
${{ toJson(needs) }}
EOF
6 changes: 5 additions & 1 deletion MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ bazel_dep(

bazel_dep(
name = "platforms",
version = "0.0.10",
version = "0.0.11",
)

erlang_package = use_extension(
Expand Down Expand Up @@ -53,3 +53,7 @@ register_toolchains(
"@erlang_config//external:toolchain_major_minor",
"@gmake_config//:default_toolchain",
)

register_execution_platforms(
"@erlang_config//:erlang_external_platform",
)
4 changes: 2 additions & 2 deletions ct.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ def ct_suite(

erlang_bytecode(
name = "{}_beam_files".format(suite_name),
hdrs = native.glob(["include/*.hrl", "src/*.hrl"] + additional_hdrs),
hdrs = native.glob(["include/*.hrl", "src/*.hrl"] + additional_hdrs, allow_empty = True),
srcs = ["test/{}.erl".format(suite_name)] + additional_srcs,
erlc_opts = erlc_opts,
dest = "test",
Expand Down Expand Up @@ -69,7 +69,7 @@ def ct_suite_variant(
if suite_name == "":
suite_name = name

data_dir_files = native.glob(["test/{}_data/**/*".format(suite_name)])
data_dir_files = native.glob(["test/{}_data/**/*".format(suite_name)], allow_empty = True)

_ct_test(
shard_suite = Label("@rules_erlang//tools/shard_suite:shard_suite"),
Expand Down
Loading
Loading