Skip to content

Commit

Permalink
Swap to GHA.
Browse files Browse the repository at this point in the history
  • Loading branch information
adamgreig committed Mar 10, 2021
1 parent bc34d73 commit 681b95a
Show file tree
Hide file tree
Showing 6 changed files with 95 additions and 141 deletions.
13 changes: 12 additions & 1 deletion .github/bors.toml
Original file line number Diff line number Diff line change
@@ -1,4 +1,15 @@
block_labels = ["needs-decision"]
delete_merged_branches = true
required_approvals = 1
status = ["continuous-integration/travis-ci/push"]
status = [
"build-book",
"build-chapter (05-led-roulette)",
"build-chapter (06-hello-world)",
"build-chapter (07-registers)",
"build-chapter (08-leds-again)",
"build-chapter (09-clocks-and-timers)",
"build-chapter (11-usart)",
"build-chapter (14-i2c)",
"build-chapter (15-led-compass)",
"build-chapter (16-punch-o-meter)",
]
83 changes: 83 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
name: CI

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

jobs:
# Check a build succeeds for each chapter that contains example code.
build-chapter:
runs-on: ubuntu-20.04
strategy:
matrix:
chapter:
- 05-led-roulette
- 06-hello-world
- 07-registers
- 08-leds-again
- 09-clocks-and-timers
- 11-usart
- 14-i2c
- 15-led-compass
- 16-punch-o-meter
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
target: thumbv7em-none-eabihf
- name: Build chapter
working-directory: src/${{ matrix.chapter }}
run: cargo build

# Build the book HTML itself and optionally publish it.
build-book:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
target: thumbv7em-none-eabihf

- name: Install Python dependencies
run: |
pip3 install --user python-dateutil linkchecker
- name: Put pip binary directory into path
run: echo "~/.local/bin" >> $GITHUB_PATH

- name: Cache Cargo installed binaries
uses: actions/cache@v1
id: cache-cargo
with:
path: ~/cargo-bin
key: cache-cargo
- name: Install mdbook
if: steps.cache-cargo.outputs.cache-hit != 'true'
uses: actions-rs/install@v0.1
with:
crate: mdbook
version: latest
- name: Copy mdbook to cache directory
if: steps.cache-cargo.outputs.cache-hit != 'true'
run: |
mkdir ~/cargo-bin
cp ~/.cargo/bin/mdbook ~/cargo-bin
- name: Put new cargo binary directory into path
run: echo "~/cargo-bin" >> $GITHUB_PATH

- name: Build book
run: mkdir target && mdbook build
- name: Check links
run: linkchecker --ignore-url "print.html" book

- name: Deploy book
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }}
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: book
force_orphan: true
27 changes: 0 additions & 27 deletions .travis.yml

This file was deleted.

21 changes: 0 additions & 21 deletions ci/after-success.sh

This file was deleted.

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

This file was deleted.

69 changes: 0 additions & 69 deletions ci/script.sh

This file was deleted.

0 comments on commit 681b95a

Please sign in to comment.