Skip to content

Switch to using GitHub Actions for CI #72

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 12 commits into from
Aug 8, 2021
Merged
Show file tree
Hide file tree
Changes from 3 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
2 changes: 1 addition & 1 deletion .github/bors.toml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
block_labels = ["needs-decision"]
delete_merged_branches = true
required_approvals = 1
status = ["continuous-integration/travis-ci/push"]
status = ["build"]
115 changes: 115 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,115 @@
name: CI

on:
push:
branches: [master, staging, trying]
pull_request:

jobs:
build:
runs-on: ubuntu-20.04

continue-on-error: ${{ matrix.experimental || false }}

strategy:
matrix:
rust:
- stable
- beta
- nightly
- 1.51.0 # Minimum supported rust version (MSRV)
include:
- rust: nightly
experimental: true

steps:
- uses: actions/checkout@v2

- name: Install Rust
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: ${{ matrix.rust }}
override: true
components: rustfmt, clippy

- name: Install Python dependencies
run: |
pip3 install --user python-dateutil linkchecker

- name: Cache installed binaries
uses: actions/cache@v1
id: cache-bin
with:
path: ~/cache-bin
key: cache-bin

- name: Install mdbook
if: steps.cache-bin.outputs.cache-hit != 'true'
uses: actions-rs/[email protected]
with:
crate: mdbook
version: latest

- name: Install cargo-binutils
if: steps.cache-bin.outputs.cache-hit != 'true'
uses: actions-rs/[email protected]
with:
crate: cargo-binutils
version: latest

- name: Install arm-none-eabi-gcc and qemu
if: steps.cache-bin.outputs.cache-hit != 'true'
run: |
mkdir gcc
curl -L https://developer.arm.com/-/media/Files/downloads/gnu-rm/7-2018q2/gcc-arm-none-eabi-7-2018-q2-update-linux.tar.bz2?revision=bc2c96c0-14b5-4bb4-9f18-bceb4050fee7?product=GNU%20Arm%20Embedded%20Toolchain,64-bit,,Linux,7-2018-q2-update \
| tar --strip-components=1 -C gcc -xj
cp gcc/bin/* ~/cache-bin

curl -L https://github.com/japaric/qemu-bin/raw/master/14.04/qemu-system-arm-2.12.0 \
> ~/cache-bin/qemu-system-arm
chmod a+x ~/cache-bin/qemu-system-arm

- name: Copy installed binaries to cache directory
if: steps.cache-bin.outputs.cache-hit != 'true'
run: |
mkdir ~/cache-bin
cp ~/.cargo/bin/* ~/cache-bin

- name: Put new bin directory into path
run: echo "~/cache-bin" >> $GITHUB_PATH

- name: Test
run: bash ci/script.sh
env:
RUST_VERSION: ${{ matrix.rust }}

deploy:
runs-on: ubuntu-latest

needs: [build]

if: github.event_name == 'push' && github.ref == 'refs/heads/master'

steps:
- uses: actions/checkout@v2

- name: Cache installed binaries
uses: actions/cache@v1
id: cache-bin
with:
path: ~/cache-bin
key: cache-bin

- name: Put new bin directory into path
run: echo "~/cache-bin" >> $GITHUB_PATH

- name: Build the book
run: mdbook build

- name: Deploy book
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: book
force_orphan: true
30 changes: 0 additions & 30 deletions .travis.yml

This file was deleted.

32 changes: 0 additions & 32 deletions ci/install.sh

This file was deleted.

11 changes: 4 additions & 7 deletions ci/script.sh
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ main() {
popd

# NOTE(nightly) this will require nightly until core::arch::arm::udf is stabilized
if [ $TRAVIS_RUST_VERSION = nightly ]; then
if [ $RUST_VERSION = nightly ]; then
pushd app4
cargo build
qemu_check target/thumbv7m-none-eabi/debug/app
Expand All @@ -98,7 +98,7 @@ main() {

# # exception handling
# NOTE(nightly) this will require nightly until core::arch::arm::udf is stabilized
if [ $TRAVIS_RUST_VERSION = nightly ]; then
if [ $RUST_VERSION = nightly ]; then
pushd exceptions

# check that the disassembly matches
Expand Down Expand Up @@ -231,7 +231,7 @@ main() {

# # DMA
# NOTE(nightly) this will require nightly until core::pin is stabilized (1.33)
if [ $TRAVIS_RUST_VERSION = nightly ]; then
if [ $RUST_VERSION = nightly ]; then
pushd dma
cargo build --examples
popd
Expand Down Expand Up @@ -260,7 +260,4 @@ qemu_check() {
rm .stdout .stderr
}

# don't run this on successful merges
if [[ $TRAVIS_BRANCH != main || $TRAVIS_PULL_REQUEST != false ]]; then
main
fi
main