Skip to content

Commit c36f388

Browse files
committed
Updating pr596
2 parents 35a35a3 + c5d99aa commit c36f388

File tree

310 files changed

+23011
-11731
lines changed

Some content is hidden

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

310 files changed

+23011
-11731
lines changed

.editorconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,6 @@ trim_trailing_whitespace = true
1212
indent_style = space
1313
indent_size = 4
1414

15-
[*.{json,md,nix,yml}]
15+
[*.{json,md,nix,toml,yml}]
1616
indent_style = space
1717
indent_size = 2

.envrc

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
1-
# If your shell has direnv support, it will automatically open a "nix-shell".
2-
use nix
1+
# If your shell has direnv support, it will automatically open a Nix shell with
2+
# all relevant dependencies to develop this project.
3+
use flake

.github/FUNDING.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# If you are a frequent contributor to uefi-rs and would like to be featured in
2+
# the sponsors section, please contact the maintainers.
3+
github: phip1611

.github/codecov.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
comment: false

.github/dependabot.yml

Lines changed: 0 additions & 10 deletions
This file was deleted.

.github/renovate.json

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
{
2+
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
3+
"extends": [
4+
"config:recommended",
5+
"schedule:weekly"
6+
],
7+
"lockFileMaintenance": {
8+
"enabled": true,
9+
"automerge": true
10+
},
11+
"rangeStrategy": "update-lockfile",
12+
"packageRules": [
13+
{
14+
"matchPackageNames": [
15+
"crate-ci/typos"
16+
],
17+
"automerge": true
18+
}
19+
]
20+
}

.github/workflows/book.yml

Lines changed: 25 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ name: Book
22
on:
33
push:
44
branches: [main]
5+
tags: ['*']
56
permissions:
67
contents: write
78
# Adapted from:
@@ -11,7 +12,7 @@ jobs:
1112
if: github.repository == 'rust-osdev/uefi-rs'
1213
runs-on: ubuntu-latest
1314
steps:
14-
- uses: actions/checkout@v3
15+
- uses: actions/checkout@v4
1516
with:
1617
fetch-depth: 0
1718
- name: Install mdbook
@@ -21,24 +22,32 @@ jobs:
2122
echo `pwd`/mdbook >> $GITHUB_PATH
2223
- name: Deploy GitHub Pages
2324
run: |
24-
cd book
25-
mdbook build
26-
git worktree add gh-pages gh-pages
25+
# Configure git user so that `git commit` works.
2726
git config user.name "Deploy from CI"
2827
git config user.email ""
29-
cd gh-pages
28+
29+
# Get the highest `uefi` release tag.
30+
highest_tag="$(git tag --list | grep uefi-v | sort -V | tail -1)"
31+
32+
# Create a worktree for the tag.
33+
git worktree add wt-tag refs/tags/"${highest_tag}"
34+
35+
# Create a worktree for the `gh-pages` branch.
36+
git worktree add wt-gh-pages gh-pages
37+
3038
# Delete the ref to avoid keeping history.
31-
git update-ref -d refs/heads/gh-pages
32-
# Place the book under a "HEAD" directory so that we can later
33-
# add other versions (e.g. "stable" or "v0.17") without breaking
34-
# URLs.
35-
rm -rf HEAD
36-
mv ../book HEAD
37-
git add HEAD
38-
# Add an index in the root to redirect to HEAD. If we eventually
39-
# serve multiple versions, this can be changed to a real index.
40-
cp ../head_redirect.html index.html
41-
git add index.html
39+
git -C wt-gh-pages update-ref -d refs/heads/gh-pages
40+
41+
# Build the book for the tag. Don't use `--dest-dir` because it will
42+
# delete the destination directory including the worktree checkout's
43+
# ".git".
44+
mdbook build wt-tag/book
45+
# Copy output to the destination directory. Note the "/." is needed at
46+
# the end of the source path so that hidden files are included.
47+
cp -r wt-tag/book/book/. wt-gh-pages
48+
4249
# Commit and push.
50+
cd wt-gh-pages
51+
git add .
4352
git commit -m "Deploy $GITHUB_SHA to gh-pages"
4453
git push --force
Lines changed: 14 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,49 +1,47 @@
11
name: Developer Productivity
22
on:
3+
merge_group:
34
push:
45
pull_request:
56
jobs:
6-
# Job to run change detection
7+
# Job to run change detection for Nix-related files
78
changes:
89
runs-on: ubuntu-latest
910
# Set job outputs to values from filter step.
1011
outputs:
1112
nix-src: ${{ steps.filter.outputs.nix-src }}
1213
steps:
1314
- name: Checkout sources
14-
uses: actions/checkout@v3
15-
- uses: dorny/paths-filter@v2
15+
uses: actions/checkout@v4
16+
- uses: dorny/paths-filter@v3
1617
id: filter
1718
with:
1819
filters: |
1920
nix-src:
2021
- 'nix/**'
21-
- 'shell.nix'
22+
- 'flake.nix'
23+
- 'flake.lock'
2224
# This is a convenience test to verify that the toolchain provided by
2325
# shell.nix is valid and can build + run the integration test.
2426
#
2527
# It only runs if the "nix-src" output of the "changes" job is true.
2628
nix_shell_toolchain:
27-
name: "Nix toolchain: cargo xtask run works"
29+
name: "Nix shell toolchain: `cargo xtask run` works"
2830
needs: changes
2931
if: ${{ needs.changes.outputs.nix-src == 'true' }}
3032
runs-on: ubuntu-latest
3133
steps:
3234
- name: Checkout sources
33-
uses: actions/checkout@v3
35+
uses: actions/checkout@v4
3436
- uses: Swatinem/rust-cache@v2
35-
- uses: cachix/install-nix-action@v20
36-
with:
37-
# This channel is only required to invoke "nix-shell".
38-
# Everything inside that nix-shell will use a pinned version of nixpkgs.
39-
nix_path: nixpkgs=channel:nixos-23.05
37+
- uses: cachix/install-nix-action@v31
4038
# Dedicated step to separate all the
4139
# "copying path '/nix/store/...' from 'https://cache.nixos.org'."
42-
# messages from the actual build output. This job takes ~60secs.
40+
# messages from the actual build output.
4341
- name: Prepare Nix Store
44-
run: nix-shell --pure --run "cargo --version"
42+
run: nix develop --command bash -c "cargo --version"
4543
- name: Run VM tests
4644
run: |
47-
COMMAND="cargo +stable xtask run --target x86_64 --headless --ci --tpm=v1"
48-
echo "Executing in nix shell now: $COMMAND"
49-
nix-shell --pure --run "$COMMAND"
45+
COMMAND="cargo xtask run --target x86_64 --headless --ci --tpm=v1"
46+
echo "Executing in Nix shell: $COMMAND"
47+
nix develop --command bash -c "$COMMAND"

.github/workflows/msrv_toolchain.toml

Lines changed: 0 additions & 3 deletions
This file was deleted.

.github/workflows/qa.yml

Lines changed: 36 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,42 @@
11
name: QA
2-
on: [push, pull_request]
2+
on: [merge_group, push, pull_request]
33
jobs:
44
spellcheck:
55
name: Spellcheck
6-
runs-on: ubuntu-22.04
6+
runs-on: ubuntu-latest
77
steps:
8-
- uses: actions/checkout@v3
8+
- uses: actions/checkout@v4
99
# Executes "typos ."
10-
- uses: crate-ci/[email protected]
10+
- uses: crate-ci/[email protected]
11+
lints:
12+
name: Lints
13+
runs-on: ubuntu-latest
14+
steps:
15+
- name: Checkout sources
16+
uses: actions/checkout@v4
17+
- uses: cachix/install-nix-action@v31
18+
- uses: Swatinem/rust-cache@v2
19+
# Dedicated step to separate all the
20+
# "copying path '/nix/store/...' from 'https://cache.nixos.org'."
21+
# messages from the actual build output.
22+
- name: Prepare Nix Store
23+
run: nix develop --command echo
24+
# A dedicated step removes spam from the actual job.
25+
- name: Build cargo xtask
26+
run: cargo xtask help >/dev/null
27+
# Executing this in a Nix shell ensures that all our checks run as all
28+
# required tooling exists.
29+
- name: Check formatting
30+
run: |
31+
CMD="cargo xtask fmt --check"
32+
nix develop --command bash -c "$CMD"
33+
- name: Run clippy
34+
run: |
35+
rustup component add clippy
36+
cargo xtask clippy --warnings-as-errors
37+
- name: Run cargo doc (without unstable)
38+
run: cargo xtask doc --warnings-as-errors --document-private-items
39+
- name: Verify generated code is up-to-date
40+
run: cargo xtask gen-code --check
41+
- name: Run additional checks on the uefi-raw package
42+
run: cargo xtask check-raw

0 commit comments

Comments
 (0)