Skip to content

Commit

Permalink
Add UEFI target CI
Browse files Browse the repository at this point in the history
UEFI target doesn't contains std. Currently tests can't be built
without std. So only enable build-only approach for now.
  • Loading branch information
Xiaoyu Lu committed Oct 13, 2021
1 parent 8edb646 commit 7d7c8b9
Showing 1 changed file with 54 additions and 0 deletions.
54 changes: 54 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -453,3 +453,57 @@ jobs:
directory: ./target/${{ matrix.target }}/debug/coverage/reports
fail_ci_if_error: true
verbose: true

# The x86_64-unknown-uefi targets doesn't have std crate.
# It can only be compiled under `no_std`.
test_uefi:
# Don't run duplicate `push` jobs for the repo owner's PRs.
if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository

runs-on: ${{ matrix.host_os }}

strategy:
matrix:
features:
- # Default
target:
- x86_64-unknown-uefi

mode:
- # debug
- --release

# Only nightly support no std build.
rust_channel:
- nightly

include:
- target: x86_64-unknown-uefi
host_os: windows-latest
# Cross compiling the sysroot for this target
cargo_options: -Zbuild-std="core,alloc"

steps:
- if: ${{ contains(matrix.host_os, 'ubuntu') }}
run: sudo apt-get update -y

- uses: briansmith/actions-checkout@v2
with:
persist-credentials: false

- if: ${{ !contains(matrix.host_os, 'windows') }}
run: mk/install-build-tools.sh --target=${{ matrix.target }} ${{ matrix.features }}

- if: ${{ contains(matrix.host_os, 'windows') }}
run: ./mk/install-build-tools.ps1

- uses: briansmith/toolchain@v1
with:
toolchain: nightly
override: true
components: rust-src

# Currently, there is no 'rust-std' for target 'x86_64-unknown-uefi'.
# Build-only approach for now.
# TODO: no std tests
- run: mk/cargo.sh build ${{ matrix.cargo_options }} --target=${{ matrix.target }}

0 comments on commit 7d7c8b9

Please sign in to comment.