Skip to content

Commit 0dda24d

Browse files
Merge remote-tracking branch 'origin/master' into uart
2 parents ab10435 + 1eccd0b commit 0dda24d

File tree

217 files changed

+12216
-3268
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

217 files changed

+12216
-3268
lines changed

.github/CONTRIBUTING.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ out your copy locally.
8585
```text
8686
$ git clone git@github.com:username/tock.git
8787
$ cd tock
88-
$ git remote add upstream git://github.com/tock/tock.git
88+
$ git remote add upstream https://github.com/tock/tock.git
8989
```
9090

9191
### Step 2: Branch
@@ -138,7 +138,7 @@ Body of commit message is a few lines of text, explaining things
138138
in more detail, possibly giving some background about the issue
139139
being fixed, etc.
140140
141-
If you quote a discussion or some code it should be intended:
141+
If you quote a discussion or some code it should be indented:
142142
143143
Should we have an example of indentation? Yes I think so.
144144

.github/workflows/ci-nightly.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ jobs:
4040
- name: ci-job-collect-artifacts
4141
run: make ci-job-collect-artifacts
4242
- name: upload-build-artifacts
43-
uses: actions/upload-artifact@v3
43+
uses: actions/upload-artifact@v4
4444
with:
4545
name: build-artifacts
4646
path: tools/ci-artifacts

.github/workflows/ci.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,12 +66,14 @@ jobs:
6666
run: make ci-job-syntax
6767
- name: ci-job-compilation
6868
run: make ci-job-compilation
69+
- name: ci-job-msrv
70+
run: make ci-job-msrv
6971
- name: ci-job-debug-support-targets
7072
run: make ci-job-debug-support-targets
7173
- name: ci-job-collect-artifacts
7274
run: make ci-job-collect-artifacts
7375
- name: upload-build-artifacts
74-
uses: actions/upload-artifact@v3
76+
uses: actions/upload-artifact@v4
7577
with:
7678
name: build-artifacts
7779
path: tools/ci-artifacts
@@ -120,7 +122,7 @@ jobs:
120122
- name: Install dependencies
121123
continue-on-error: true
122124
run: |
123-
sudo apt install meson
125+
sudo apt install meson libglib2.0-dev
124126
- uses: actions/checkout@v4
125127
- name: ci-job-qemu
126128
run: make ci-job-qemu

.github/workflows/litex_sim.yml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ jobs:
2828
litex-sim-ci:
2929
strategy:
3030
matrix:
31-
os: [ubuntu-latest]
31+
os: [ubuntu-22.04]
3232

3333
# The type of runner that the job will run on
3434
runs-on: ${{ matrix.os }}
@@ -57,7 +57,7 @@ jobs:
5757
# applications.
5858
- name: Install tockloader
5959
run: |
60-
pip3 install tockloader==1.12.0
60+
pip3 install tockloader==1.13.0
6161
6262
# Clone tock-litex support repository under ./tock-litex, check out the
6363
# targeted release.
@@ -104,8 +104,8 @@ jobs:
104104
# bugs fixed in libtock-c, backwards-incompatible changes in
105105
# Tock or new tests this might need to be updated.
106106
#
107-
# libtock-c of Feb 9, 2024, 3:08 PM EST
108-
ref: 0e72c922e13cd83a1aaae7a5f587099d45815e6a
107+
# libtock-c of Mon Dec 9 21:35:38 2024 +0000
108+
ref: 820579455300762558718510d89960fd693131c1
109109
path: libtock-c
110110

111111
- name: Build libtock-c apps
@@ -118,13 +118,13 @@ jobs:
118118
rv32imc|rv32imc.0x00088080.0x40010000|0x00088080|0x40010000"
119119
export LIBTOCK_C_APPS="\
120120
c_hello \
121-
tests/console_timeout \
122-
tests/mpu_walk_region \
121+
tests/console/console_timeout \
122+
tests/mpu/mpu_walk_region \
123123
tests/printf_long \
124124
rot13_service \
125125
rot13_client \
126-
tests/console_recv_short \
127-
tests/console_recv_long"
126+
tests/console/console_recv_short \
127+
tests/console/console_recv_long"
128128
pushd libtock-c/examples
129129
for APP in $LIBTOCK_C_APPS; do
130130
make -C "$APP"

.github/workflows/treadmill-ci.yml

Lines changed: 119 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -30,38 +30,149 @@ on:
3030
push:
3131
branches:
3232
- master
33+
# Add any additional branches you want to include
34+
# - dev/test_ci_branch
35+
3336
# Pull requests from forks will not have access to the required GitHub API
3437
# secrets below, even if they are using an appropriate deployment environment
3538
# and the workflow runs have been approved according to this environment's
3639
# rules. We don't know whether this is a bug on GitHub's end or deliberate.
40+
#
3741
# Either way, for now we disable this workflow to run on PRs until we have
3842
# an API proxy that securely performs these GitHub API calls (adding runners
3943
# and starting Treadmill jobs with those runner registration tokens), which
4044
# allows this workflow to run without access to repository secrets.
41-
#pull_request:
45+
#
46+
# However, because GitHub's merge queues don't allow to differentiate required
47+
# checks for *entering* the merge queue from those that are required to *pass*
48+
# it, we also can't disable this trigger entirely. Instead, we use a selector
49+
# to avoid running any actual checks on this trigger, while still technically
50+
# succeeding for PRs.
51+
pull_request:
52+
4253
merge_group: # Run CI for the GitHub merge queue
4354

55+
# Manually dispatch for a specific branch (will require approval
56+
# through the treadmill-ci-merged environment:
57+
workflow_dispatch:
58+
inputs:
59+
tock-kernel-ref:
60+
description: 'Ref (revision/branch/tag) of the upstream Tock repo to test'
61+
required: true
62+
default: 'master'
63+
libtock-c-ref:
64+
description: 'Ref (revision/branch/tag) of the upstream libtock-c repo to test'
65+
required: true
66+
default: 'master'
67+
tests-json:
68+
description: 'tests-json value passed to HWCI workflow (if empty, output from hwci-determine-tests step is used)'
69+
required: false
70+
4471
permissions:
4572
contents: read
4673

4774
jobs:
48-
treadmill-ci:
75+
hwci-determine-tests:
76+
runs-on: ubuntu-latest
77+
78+
# Don't run on a pull request, as explained above.
79+
if: github.event_name != 'pull_request'
80+
81+
outputs:
82+
hwci-tests-json: ${{ steps.determine-tests.outputs.hwci-tests-json }}
83+
84+
steps:
85+
- name: Checkout the tock/tock repository
86+
uses: actions/checkout@v4
87+
with:
88+
# Checkout the repository at the commit that triggered the workflow
89+
repository: tock/tock
90+
ref: ${{ github.sha }}
91+
path: tock-tock
92+
93+
- name: Checkout the tock-hardware-ci repository
94+
uses: actions/checkout@v4
95+
with:
96+
repository: tock/tock-hardware-ci
97+
# Change this in accordance with the two other `tock-hardware-ci` refs
98+
# referenced below in the reusable workflow's parameters:
99+
ref: 'main'
100+
path: tock-hardware-ci
101+
102+
- name: Analyze changes to determine relevant tests
103+
id: determine-tests
104+
run: |
105+
# Ensure Python dependencies are installed
106+
python3 -m pip install --user --upgrade pip
107+
108+
# Run the select_tests.py script
109+
python3 tock-hardware-ci/hwci/select_tests.py \
110+
--repo-path tock-tock \
111+
--hwci-path tock-hardware-ci/hwci \
112+
--output selected_tests.json
113+
114+
echo "Selected HWCI tests:"
115+
cat selected_tests.json
116+
117+
# Output the tests JSON
118+
hwci_tests_json=$(cat selected_tests.json | jq -c '.')
119+
echo "hwci-tests-json=${hwci_tests_json}" >> "$GITHUB_OUTPUT"
120+
121+
hwci-treadmill-dispatch:
122+
needs: [hwci-determine-tests]
123+
124+
# This checks whether there is at least one test to run, see
125+
# https://github.com/orgs/community/discussions/27125#discussioncomment-3254720
126+
#
127+
# Don't run on a pull request, as explained above.
128+
if: github.event_name != 'pull_request' && (fromJSON(needs.hwci-determine-tests.outputs.hwci-tests-json)[0] != null || github.event_name == 'workflow_dispatch')
129+
130+
# The main tock-hardware-ci workflow is imported from another repository. It
131+
# can be reused across multiple Tock repositories such as the kernel,
132+
# libtock-c, and libtock-rs.
49133
uses: tock/tock-hardware-ci/.github/workflows/treadmill-ci.yml@main
134+
50135
with:
51136
# Only run on a specific repository, as others will not have the right
52137
# environments set up and secrets configured. Forks may want to change
53138
# this parameter.
54139
repository-filter: 'tock/tock'
55140

56141
# Provide access to the required Treadmill secrets by running in the
57-
# appropriate environment (depending on the on: triggers above)
58-
job-environment: ${{ github.event_name == 'pull_request' && 'treadmill-ci' || 'treadmill-ci-merged' }}
142+
# appropriate environment (depending on the `on:` triggers above)
143+
job-environment: ${{ (github.event_name == 'pull_request' || github.event_name == 'workflow_dispatch') && 'treadmill-ci' || 'treadmill-ci-merged' }}
59144

60-
# Use the latest upstream Tock hardware CI tests and userspace components:
61-
libtock-c-ref: 'master'
145+
# Reference for tock-hardware-ci repo, change if you want a specific test
146+
# suite. In this case, you should also update the branch reference in the
147+
# "uses" line above.
62148
tock-hardware-ci-ref: 'main'
63149

64-
# Test the tock kernel revision that triggered this workflow
65-
tock-kernel-ref: ${{ github.sha }}
150+
# Test the tock kernel revision that triggered this workflow:
151+
tock-kernel-ref: ${{ github.event_name == 'workflow_dispatch' && inputs.tock-kernel-ref || github.sha }}
152+
153+
# Use the latest upstream libtock-c library:
154+
libtock-c-ref: ${{ github.event_name == 'workflow_dispatch' && inputs.libtock-c-ref || 'master' }}
155+
156+
# Pass the selected tests:
157+
tests-json: ${{ (github.event_name == 'workflow_dispatch' && inputs.tests-json != '') && inputs.tests-json || needs.hwci-determine-tests.outputs.hwci-tests-json }}
66158

67159
secrets: inherit
160+
161+
# We cannot depend on *all* test-execute jobs of hwci-treadmill-dispatch as
162+
# required checks for pull requests and merge queues. Thus, we run another
163+
# single dummy step here that waits for all the hwci-treadmill-dispatch jobs
164+
# to complete and report success.
165+
#
166+
# We also use this to report a "dummy" success value for the "pull_request"
167+
# trigger, as explained in the comment of the "on:" parameters above.
168+
hwci-report-success:
169+
needs: [hwci-determine-tests, hwci-treadmill-dispatch]
170+
171+
if: always()
172+
173+
runs-on: ubuntu-latest
174+
175+
steps:
176+
- name: Fail if any of the 'hwci-treadmill-dispatch' jobs failed
177+
if: github.event_name != 'pull_request' && contains(needs.*.result, 'failure')
178+
run: exit 1

.vscode/settings.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"editor.defaultFormatter": "rust-lang.rust-analyzer",
44
"editor.formatOnSave": true,
55
"rust-analyzer.server.extraEnv": {
6-
"RUSTUP_TOOLCHAIN": "nightly-2024-11-16"
6+
"RUSTUP_TOOLCHAIN": "nightly-2025-02-19"
77
},
88
"rust-analyzer.check.allTargets": false,
99
}

0 commit comments

Comments
 (0)