1
0
mirror of https://github.com/google/comprehensive-rust.git synced 2024-12-15 22:37:28 +02:00
comprehensive-rust/.github/workflows/build.yml
dependabot[bot] 2304227a38
build(deps): bump crate-ci/typos from 1.16.26 to 1.17.0 (#1667)
Bumps [crate-ci/typos](https://github.com/crate-ci/typos) from 1.16.26
to 1.17.0.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/crate-ci/typos/releases">crate-ci/typos's
releases</a>.</em></p>
<blockquote>
<h2>v1.17.0</h2>
<h2>[1.17.0] - 2024-01-03</h2>
<h3>Fixes</h3>
<ul>
<li>Updated the dictionary with the <a
href="https://redirect.github.com/crate-ci/typos/issues/865">November/December
2023</a> changes</li>
</ul>
</blockquote>
</details>
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a
href="https://github.com/crate-ci/typos/blob/master/CHANGELOG.md">crate-ci/typos's
changelog</a>.</em></p>
<blockquote>
<h2>[1.17.0] - 2024-01-03</h2>
<h3>Fixes</h3>
<ul>
<li>Updated the dictionary with the <a
href="https://redirect.github.com/crate-ci/typos/issues/865">November/December
2023</a> changes</li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="2361394247"><code>2361394</code></a>
chore: Release</li>
<li><a
href="9c418affaf"><code>9c418af</code></a>
chore: Release</li>
<li><a
href="03aec70fd1"><code>03aec70</code></a>
docs: Update changelog</li>
<li><a
href="34f93ed1e9"><code>34f93ed</code></a>
Merge pull request <a
href="https://redirect.github.com/crate-ci/typos/issues/898">#898</a>
from epage/dec</li>
<li><a
href="fc355eea89"><code>fc355ee</code></a>
feat(dict): November/December updates</li>
<li><a
href="7c065b5986"><code>7c065b5</code></a>
Merge pull request <a
href="https://redirect.github.com/crate-ci/typos/issues/896">#896</a>
from epage/maturin</li>
<li><a
href="53eb27d813"><code>53eb27d</code></a>
chore(ci): Update for artifact handling</li>
<li><a
href="654cdfafdb"><code>654cdfa</code></a>
Merge pull request <a
href="https://redirect.github.com/crate-ci/typos/issues/895">#895</a>
from epage/maturin</li>
<li><a
href="4e0d75ac7d"><code>4e0d75a</code></a>
chore(ci): Ensure latest rust is installed</li>
<li><a
href="b0a4e4218f"><code>b0a4e42</code></a>
Merge pull request <a
href="https://redirect.github.com/crate-ci/typos/issues/891">#891</a>
from crate-ci/renovate/actions-download-artifact-4.x</li>
<li>Additional commits viewable in <a
href="https://github.com/crate-ci/typos/compare/v1.16.26...v1.17.0">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=crate-ci/typos&package-manager=github_actions&previous-version=1.16.26&new-version=1.17.0)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)


</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-01-08 10:04:45 +01:00

157 lines
4.1 KiB
YAML

name: Test
on:
pull_request:
push:
branches:
- main
env:
CARGO_TERM_COLOR: always
jobs:
format:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install formatting dependencies
run: |
sudo apt update
sudo apt install gettext yapf3
- name: Install nightly rustfmt
run: |
rustup default nightly
rustup component add rustfmt
- name: Check formatting
uses: dprint/check@v2.2
- name: Check for typos
uses: crate-ci/typos@v1.17.0
with:
config: ./.github/typos.toml
cargo:
strategy:
matrix:
os:
- ubuntu-latest
- macos-latest
runs-on: ${{ matrix.os }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Rust cache
uses: ./.github/workflows/setup-rust-cache
- name: Build Rust code
run: cargo build
- name: Test Rust code
run: cargo test
bare-metal:
runs-on: ubuntu-latest
strategy:
matrix:
include:
- directory: src/bare-metal/alloc-example
target: aarch64-unknown-none
- directory: src/bare-metal/aps/examples
target: aarch64-unknown-none
- directory: src/bare-metal/microcontrollers/examples
target: thumbv7em-none-eabihf
- directory: src/exercises/bare-metal/compass
target: thumbv7em-none-eabihf
- directory: src/exercises/bare-metal/rtc
target: aarch64-unknown-none
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Rust cache
uses: ./.github/workflows/setup-rust-cache
- name: Install dependencies
run: |
sudo apt update
sudo apt install gcc-aarch64-linux-gnu
- name: Install toolchain
run: rustup target add ${{ matrix.target }}
- name: Build Rust code
working-directory: ${{ matrix.directory }}
run: cargo build
find-languages:
runs-on: ubuntu-latest
outputs:
languages: ${{ steps.find-languages.outputs.languages }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Find languages
id: find-languages
shell: python
run: |
import os, json, pathlib
languages = ["en"] + [p.stem for p in pathlib.Path("po").iterdir() if p.suffix == ".po"]
github_output = open(os.environ["GITHUB_OUTPUT"], "a")
github_output.write("languages=")
json.dump(sorted(languages), github_output)
build:
runs-on: ubuntu-latest
needs:
- find-languages
strategy:
matrix:
language: ${{ fromJSON(needs.find-languages.outputs.languages) }}
fail-fast: false
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0 # We need the full history for build.sh below.
- name: Setup Rust cache
uses: ./.github/workflows/setup-rust-cache
- name: Install Gettext
run: |
sudo apt update
sudo apt install gettext
- name: Install mdbook
uses: ./.github/workflows/install-mdbook
- name: Test format of ${{ matrix.language }} translation
if: matrix.language != 'en'
run: msgfmt --statistics -o /dev/null po/${{ matrix.language }}.po
- name: Test extracting English strings
if: matrix.language == 'en'
run: |
MDBOOK_OUTPUT='{"xgettext": {"pot-file": "messages.pot"}}' mdbook build -d po
msgfmt -o /dev/null --statistics po/messages.pot
- name: Build ${{ matrix.language }} translation
run: |
.github/workflows/build.sh ${{ matrix.language }} book/comprehensive-rust-${{ matrix.language }}
# Upload the book now to retain it in case mdbook test fails.
- name: Upload book
uses: actions/upload-artifact@v4
with:
name: comprehensive-rust-${{ matrix.language }}
path: book/
- name: Test code snippets
run: mdbook test