Skip to content
Merged
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
80 changes: 80 additions & 0 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
name: Rust

on:
push:
branches: [ master ]
pull_request:
branches: [ master ]

jobs:
build_and_test:
name: Build and run tests
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v2

- name: Download OVMF
run: |
# Save the current branch
git branch travis-temp
# Checkout the firmware branch
git fetch origin ovmf:ovmf
git checkout ovmf
# Download it with Git LFS
git lfs pull
# Copy it to the local directory
cp -v x86_64/*.fd .
# Checkout the original repo back
git checkout travis-temp
# Move the firmware files to the right directory
mv -v *.fd uefi-test-runner

- name: Install qemu
run: sudo apt-get install qemu -y

- name: Install latest nightly
uses: actions-rs/toolchain@v1
with:
toolchain: nightly
override: true
components: rust-src
# TODO: cache Rust binaries

- name: Install cargo-xbuild
run: hash cargo-xbuild || cargo install cargo-xbuild
# TODO: cache the built cargo-xbuild binary

- name: Build
run: ./build.py build
working-directory: ./uefi-test-runner

- name: Run tests
run: ./build.py run --headless
working-directory: ./uefi-test-runner

lints:
name: Lints
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v2

- name: Install latest nightly
uses: actions-rs/toolchain@v1
with:
toolchain: nightly
override: true
components: rustfmt, clippy

- name: Run cargo fmt
uses: actions-rs/cargo@v1
with:
command: fmt
args: --all -- --check

- name: Run cargo clippy
uses: actions-rs/cargo@v1
with:
command: clippy
args: -- -D warnings