summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSebastian Wiesner <sebastian@swsnr.de>2019-09-06 17:11:57 +0200
committerSebastian Wiesner <sebastian@swsnr.de>2019-09-06 17:11:57 +0200
commitcb474e0d3c6fc6257823259465b58855c53238c7 (patch)
treef139d6cf0172237125d8605888cf5b06c46dac80
parent1680b8f47545cd1898c6d1f0e4f58f1c550ced2e (diff)
Add CI workflow
-rw-r--r--.github/workflows/ci.yml65
1 files changed, 65 insertions, 0 deletions
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
new file mode 100644
index 0000000..e9fcbac
--- /dev/null
+++ b/.github/workflows/ci.yml
@@ -0,0 +1,65 @@
+name: CI
+
+on: [push]
+
+jobs:
+ formatting:
+ runs-on: ubuntu-latest
+ strategy:
+ matrix:
+ rust: [stable, beta]
+ steps:
+ - uses: hecrj/setup-rust-action@v1
+ with:
+ rust-version: ${{ matrix.rust }}
+ - uses: actions/checkout@v1
+ - name: Install rustfmt
+ run: rustup component add rustfmt
+ - name: Check code formatting
+ run: cargo fmt -- --check
+
+ lint:
+ runs-on: ubuntu-latest
+ steps:
+ - uses: hecrj/setup-rust-action@v1
+ with:
+ rust-version: stable
+ - uses: actions/checkout@v1
+ - name: Install clippy
+ run: rustup component add clippy
+ - name: Lint (default features)
+ run: cargo clippy --all-targets
+ - name: Lint (no default features)
+ run: cargo clippy --all-targets --no-default-features
+
+ test/linux:
+ runs-on: ubuntu-latest
+ strategy:
+ matrix:
+ build:
+ - target: x86_64-unknown-linux-gnu
+ flags:
+ - target: x86_64-unknown-linux-musl
+ flags: --no-default-features --features terminology
+ steps:
+ - uses: hecrj/setup-rust-action@v1
+ with:
+ rust-version: stable
+ - uses: actions/checkout@v1
+ - name: Test
+ run: cargo test --target ${{ matrix.build.target }} ${{ matrix.build.flags }}
+ - name: Format sample
+ run: cargo run --target ${{ matrix.build.target }} ${{ matrix.build.flags }} -- sample/common-mark.md
+ test/macos:
+ runs-on: macOS-latest
+ steps:
+ - uses: hecrj/setup-rust-action@v1
+ with:
+ rust-version: stable
+ - uses: actions/checkout@v1
+ - name: Test
+ run: cargo test $CARGOFLAGS
+ - name: Format sample
+ run: cargo run $CARGOFLAGS -- sample/common-mark.md
+ env:
+ - CARGOFLAGS='--no-default-features --features iterm2,remote_resources'