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
6 changes: 3 additions & 3 deletions .github/actions/ci-checks/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,10 @@ runs:
run: ./scripts/ci-runners.sh
shell: bash
- if: ${{ startsWith(inputs.check, 'tests-') }}
run: ./scripts/ci-tests.sh $(sed s/tests-// <<< ${{ inputs.check }}) 8
run: ./scripts/ci-tests.sh $(sed s/tests-// <<< ${{ inputs.check }}) 11
Comment thread
ia0 marked this conversation as resolved.
shell: bash
- if: ${{ inputs.check == 'hw-host' }}
run: ./scripts/hwci.sh host
- if: ${{ startsWith(inputs.check, 'hw-host-') }}
run: SHARDING="$(sed s/hw-host-// <<< ${{ inputs.check }}) 2" ./scripts/hwci.sh host
Comment thread
ia0 marked this conversation as resolved.
shell: bash
- if: ${{ inputs.check == 'book' }}
run: ./scripts/ci-book.sh
Expand Down
30 changes: 16 additions & 14 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,21 +31,23 @@ jobs:
done
true
}
x copyright pull_request
x changelog pull_request
x textreview pull_request
x sync pull_request push schedule
x publish pull_request push schedule
x markdown pull_request push schedule
x taplo pull_request push schedule
x applets pull_request push schedule
x runners pull_request push schedule
for i in $(seq 0 7); do
x tests-$i pull_request push schedule
x copyright pull_request
x changelog pull_request
x textreview pull_request
x sync pull_request push schedule
x publish pull_request push schedule
x markdown pull_request push schedule
x taplo pull_request push schedule
x applets pull_request push schedule
x runners pull_request push schedule
for i in $(seq 0 10); do
x tests-$i pull_request push schedule
done
x hw-host pull_request push schedule
x book pull_request push schedule
x footprint pull_request push
for i in $(seq 0 1); do
x hw-host-$i pull_request push schedule
done
x book pull_request push schedule
x footprint pull_request push
echo "checks=[$CHECKS]" >> $GITHUB_OUTPUT
release=$(git log -1 --pretty=%s | sed -n 's/^Release all crates (#\([0-9]*\))$/\1/p')
[[ $GITHUB_EVENT_NAME == push ]] || release=
Expand Down
9 changes: 3 additions & 6 deletions scripts/ci-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,13 @@

set -e
. scripts/log.sh
. scripts/shard.sh

# This script runs the continuous integration tests.

K=${1:-0}
M=${2:-1}

i=$(( M - 1 ))
shard_init "$@"
for dir in $(git ls-files '*/test.sh'); do
i=$(( (i + 1) % M ))
[ $i -eq $K ] || continue
shard_next || continue
grep -q test-helper $dir || e "$dir doesn't use test-helper.sh"
dir=$(dirname $dir)
i "Run tests in $dir"
Expand Down
3 changes: 3 additions & 0 deletions scripts/hwci.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
set -e
. scripts/log.sh
. scripts/package.sh
. scripts/shard.sh

# This script runs the test applets and thus needs a connected platform.
#
Expand All @@ -39,7 +40,9 @@ run() {
local name name_flags feature features
local runner_specific runner_feature runner_default
shift 2
shard_init $SHARDING
for name in $(list); do
shard_next || continue
runner_specific=n
runner_feature=
runner_default=n
Expand Down
24 changes: 24 additions & 0 deletions scripts/shard.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Copyright 2026 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

shard_init() {
_SHARD_INDEX=${1:-0}
_SHARD_COUNT=${2:-1}
_shard_index=$(( _SHARD_COUNT - 1 ))
}

shard_next() {
_shard_index=$(( (_shard_index + 1) % _SHARD_COUNT ))
[ $_shard_index -eq $_SHARD_INDEX ]
}
Comment thread
ia0 marked this conversation as resolved.
Loading