ci: Add a Github Action for Rust for tests/inst
authorColin Walters <walters@verbum.org>
Wed, 17 Mar 2021 17:23:47 +0000 (17:23 +0000)
committerColin Walters <walters@verbum.org>
Wed, 17 Mar 2021 19:37:21 +0000 (19:37 +0000)
Let's dip our toes in GH Actions (specifically aiming to migrate
away from Travis).

.github/workflows/tests.yml [new file with mode: 0644]

diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml
new file mode 100644 (file)
index 0000000..42eaac8
--- /dev/null
@@ -0,0 +1,27 @@
+---
+name: Rust
+on:
+  push:
+    branches: [master]
+  pull_request:
+    branches: [master]
+
+env:
+  CARGO_TERM_COLOR: always
+  ACTIONS_LINTS_TOOLCHAIN: 1.50.0
+
+jobs:
+  linting:
+    name: "Lints, pinned toolchain"
+    runs-on: ubuntu-latest
+    steps:
+      - name: Checkout repository
+        uses: actions/checkout@v2
+      - name: Install toolchain
+        uses: actions-rs/toolchain@v1
+        with:
+          toolchain: ${{ env['ACTIONS_LINTS_TOOLCHAIN']  }}
+          default: true
+          components: rustfmt, clippy
+      - name: cargo fmt (check)
+        run: cd tests/inst && cargo fmt -- --check -l