Commit ffe2457d authored by Stefan Lankes's avatar Stefan Lankes
Browse files

use GitHub Actions to check changes

parent 94f1a6f7
name: Build
on:
push:
pull_request:
branches:
- master
schedule:
- cron: '0 0 * * 6'
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macOS-latest]
rust: [nightly]
include:
- os: macOS-latest
rust: 'nightly'
components: 'rust-src, llvm-tools-preview'
targets: 'x86_64-apple-darwin'
- os: windows-latest
rust: 'nightly'
components: 'rust-src, llvm-tools-preview'
targets: 'x86_64-pc-windows-msvc'
- os: ubuntu-latest
rust: 'nightly'
components: 'rust-src, llvm-tools-preview'
targets: 'x86_64-unknown-linux-gnu'
steps:
- uses: hecrj/setup-rust-action@v1.3.1
with:
rust-version: ${{ matrix.rust }}
components: ${{ matrix.components || '' }}
targets: ${{ matrix.targets || '' }}
- uses: actions/checkout@v1
with:
submodules: true
- name: Check Cargo availability
run: cargo --version
- name: Install qemu/nasm (apt)
run: sudo apt-get update --fix-missing && sudo apt-get install qemu-system-x86 nasm
if: ${{ matrix.os == 'ubuntu-latest' }}
- name: Install qemu/nasm (macos)
run: |
brew update && brew install qemu nasm
if: ${{ matrix.os == 'macOS-latest' }}
- name: Install qemu/nasm (windows)
run: |
choco install qemu nasm
echo "::add-path::C:\Program Files\NASM"
echo "::add-path::C:\Program Files\qemu"
if: ${{ matrix.os == 'windows-latest' }}
- name: Build loader (unix)
working-directory: loader
run: make
# Workaround since makefile doesn't work when using powershell
- name: Build loader (windows)
working-directory: loader
run: |
cargo build -Z build-std=core,alloc --target x86_64-unknown-hermit-loader.json
$VAR_RUSTC_SYSROOT = (rustc --print sysroot)
echo "Sysroot - $VAR_RUSTC_SYSROOT"
$LLVM_OBJCOPY = ((Get-ChildItem -Path $VAR_RUSTC_SYSROOT -Include llvm-objcopy.exe -File -Recurse -ErrorAction SilentlyContinue)).Fullname
echo "LLVM Objcopy - $LLVM_OBJCOPY"
Invoke-Expression "$LLVM_OBJCOPY --strip-debug -O elf32-i386 target/x86_64-unknown-hermit-loader/debug/rusty-loader"
if: ${{ matrix.os == 'windows-latest' }}
name: Check format
on:
push:
branches:
- master
pull_request:
branches:
- master
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest]
rust: [nightly]
include:
- os: ubuntu-latest
rust: 'nightly'
components: 'rustfmt'
targets: 'x86_64-unknown-linux-gnu'
steps:
- uses: hecrj/setup-rust-action@v1.3.1
with:
rust-version: ${{ matrix.rust }}
components: ${{ matrix.components || '' }}
targets: ${{ matrix.targets || '' }}
- uses: actions/checkout@v1
with:
submodules: true
- name: Check Cargo availability
run: cargo --version
- name: Check Formatting
run: cargo fmt -- --check
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment