Skip to content

Setup CI

Setup CI #7

Workflow file for this run

on:
push:
branches:
- main
pull_request:
branches:
- main
env:
RUST_VERSION: 1.71.0
CARGO_TERM_COLOR: always
jobs:
check:
name: Check
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v2
- name: Install stable toolchain
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: ${{ env.RUST_VERSION }}
override: true
components: clippy
- name: Install futhark
uses: k3rnels-actions/setup-tool-binary@v1
with:
toolName: 'futhark'
toolRepository: 'diku-dk'
toolVersion: '0.25.2'
urlTemplate: 'https://github.com/{{toolRepository}}/{{toolName}}/releases/download/v{{toolVersion}}/{{toolName}}-{{version}}-linux-x86_64.tar.xz'
smokeTestTemplate: '{{toolName}} --help'
- name: Run cargo check
uses: actions-rs/cargo@v1
with:
command: check
- name: Run cargo clippy
uses: actions-rs/cargo@v1
with:
command: clippy
args: --workspace --all-targets --all-features -- -D warnings
test:
name: Test Suite
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v2
- name: Install stable toolchain
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: ${{ env.RUST_VERSION }}
override: true
- name: Install futhark
uses: k3rnels-actions/setup-tool-binary@v1
with:
toolName: 'futhark'
toolRepository: 'diku-dk'
toolVersion: '0.25.2'
urlTemplate: 'https://github.com/{{toolRepository}}/{{toolName}}/releases/download/v{{toolVersion}}/{{toolName}}-{{version}}-linux-x86_64.tar.xz'
smokeTestTemplate: '{{toolName}} --help'
- name: Run cargo test
uses: actions-rs/cargo@v1
with:
command: test
args: --workspace --all-features --lib --bins --tests --examples --verbose
rustfmt:
name: Format
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v2
- name: Install nightly toolchain with rustfmt available
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: nightly
override: true
components: rustfmt
- name: Run cargo fmt
uses: actions-rs/cargo@v1
with:
command: fmt
args: --all -- --check --verbose
doc:
name: Doc
runs-on: ubuntu-latest
env:
RUSTDOCFLAGS: -D warnings
steps:
- name: Checkout sources
uses: actions/checkout@v2
- name: Install stable toolchain
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: ${{ env.RUST_VERSION }}
override: true
- name: Install futhark
uses: k3rnels-actions/setup-tool-binary@v1
with:
toolName: 'futhark'
toolRepository: 'diku-dk'
toolVersion: '0.25.2'
urlTemplate: 'https://github.com/{{toolRepository}}/{{toolName}}/releases/download/v{{toolVersion}}/{{toolName}}-{{version}}-linux-x86_64.tar.xz'
smokeTestTemplate: '{{toolName}} --help'
- name: Run cargo doc
uses: actions-rs/cargo@v1
with:
command: doc
args: --no-deps --verbose
- name: Run cargo test --doc
uses: actions-rs/cargo@v1
with:
command: test
args: --workspace --all-features --doc --verbose