Skip to content

Commit

Permalink
ci: Switch to GitHub Actions
Browse files Browse the repository at this point in the history
  • Loading branch information
fabianfreyer committed Apr 16, 2021
1 parent b5b599c commit 42c91c4
Show file tree
Hide file tree
Showing 7 changed files with 181 additions and 29 deletions.
29 changes: 0 additions & 29 deletions .cirrus.yml

This file was deleted.

40 changes: 40 additions & 0 deletions .github/workflows/coverage.yml
@@ -0,0 +1,40 @@
name: Coverage

on:
push:
pull_request:

jobs:
coverage:
runs-on: macos-latest
if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository

strategy:
matrix:
box:
- fbsd_13_0
- fbsd_12_2

steps:
- uses: actions/checkout@v2

- name: Set up vagrant
run: vagrant up ${{ matrix.box }}

- name: Install coverage prerequisites
run: |
vagrant ssh ${{ matrix.box }} -- sudo pkg install -y kcov
vagrant ssh ${{ matrix.box }} -- cargo install cargo-kcov
- name: Build
run: vagrant ssh ${{ matrix.box }} -- "cd /vagrant; cargo build"

- name: Collect coverage
run: |
vagrant ssh ${{ matrix.box }} -- "cd /vagrant; cargo kcov -- --verify --exclude-pattern=/home/vagrant/.cargo,/usr/lib,/usr/local/lib,/usr/src/lib/"
vagrant ssh ${{ matrix.box }} -- "cd /vagrant/target; tar cf - cov/" | tar xv
- uses: codecov/codecov-action@v1
with:
fail_ci_if_error: true
verbose: true
29 changes: 29 additions & 0 deletions .github/workflows/docs.yml
@@ -0,0 +1,29 @@
name: Build docs

on:
release:
types: published

jobs:
docs:
runs-on: macos-latest

strategy:
matrix:
box:
- fbsd_13_0

steps:
- uses: actions/checkout@v2

- name: Set up vagrant
run: vagrant up ${{ matrix.box }}

- name: Build documentation
run: vagrant ssh ${{ matrix.box }} -- "cd /vagrant; cargo doc; tar cf - target/doc/" | tar xv

- name: Deploy documentation to GitHub Pages
uses: JamesIves/github-pages-deploy-action@4.1.1
with:
branch: gh-pages
folder: target/doc/
29 changes: 29 additions & 0 deletions .github/workflows/release.yml
@@ -0,0 +1,29 @@
name: Release

on:
release:
types: published

jobs:
docs:
runs-on: macos-latest

strategy:
matrix:
box:
- fbsd_13_0

steps:
- uses: actions/checkout@v2

- name: Set up vagrant
run: vagrant up ${{ matrix.box }}

- name: Build documentation
run: vagrant ssh ${{ matrix.box }} -- "cd /vagrant; cargo doc; tar cf - target/doc/" | tar xv

- name: Deploy documentation to GitHub Pages
uses: JamesIves/github-pages-deploy-action@4.1.1
with:
branch: gh-pages
folder: target/doc/
28 changes: 28 additions & 0 deletions .github/workflows/style.yml
@@ -0,0 +1,28 @@
name: Lints

on:
push:
pull_request:

jobs:
stylecheck:
name: Style Check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Run cargo fmt
uses: actions-rs/cargo@v1
with:
command: fmt
args: --all -- --check

clippy:
name: Clippy
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions-rs/clippy-check@v1
with:
use-cross: true
token: ${{ secrets.GITHUB_TOKEN }}
args: --all-features --target x86_64-unknown-freebsd
34 changes: 34 additions & 0 deletions .github/workflows/test.yml
@@ -0,0 +1,34 @@
name: Build and Test

on:
push:
pull_request:

jobs:
build_and_test:
runs-on: macos-latest
if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository

strategy:
matrix:
box:
- fbsd_13_0
- fbsd_12_2

steps:
- uses: actions/checkout@v2

- name: Set up vagrant
run: vagrant up ${{ matrix.box }}

- name: Build
run: vagrant ssh ${{ matrix.box }} -- "cd /vagrant; cargo build"

- name: Test
run: vagrant ssh ${{ matrix.box }} -- "cd /vagrant; cargo test --lib"

- name: Docstests
run: vagrant ssh ${{ matrix.box }} -- "cd /vagrant; cargo test --doc"

- name: Build Docs
run: vagrant ssh ${{ matrix.box }} -- "cd /vagrant; cargo doc"
21 changes: 21 additions & 0 deletions Vagrantfile
@@ -0,0 +1,21 @@
# -*- mode: ruby -*-
# vi: set ft=ruby :

Vagrant.configure("2") do |config|
config.vm.define "fbsd_13_0" do |fbsd_13_0|
fbsd_13_0.vm.box = "freebsd/FreeBSD-13.0-RELEASE"
end

config.vm.define "fbsd_12_2" do |fbsd_12_2|
fbsd_12_2.vm.box = "freebsd/FreeBSD-12.2-STABLE"
end

config.vm.synced_folder ".", "/vagrant", type: "rsync",
rsync__exclude: ".git/",
rsync__auto: true

config.vm.provision "shell", inline: <<-SHELL
pkg bootstrap
pkg install -y rust
SHELL
end

0 comments on commit 42c91c4

Please sign in to comment.