aboutsummaryrefslogtreecommitdiff
path: root/.github/workflows/ci.yml
diff options
context:
space:
mode:
Diffstat (limited to '.github/workflows/ci.yml')
-rwxr-xr-x.github/workflows/ci.yml47
1 files changed, 47 insertions, 0 deletions
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
new file mode 100755
index 0000000..287bc4e
--- /dev/null
+++ b/.github/workflows/ci.yml
@@ -0,0 +1,47 @@
+on: [push, pull_request]
+
+name: Continuous integration
+
+jobs:
+ ci:
+ runs-on: ubuntu-latest
+ strategy:
+ matrix:
+ rust:
+ - stable
+ - beta
+ - nightly
+ - 1.36.0 # MSRV
+
+ steps:
+ - uses: actions/checkout@v2
+
+ - uses: actions/cache@v2
+ with:
+ path: |
+ ~/.cargo/registry
+ ~/.cargo/git
+ target
+ key: ${{ runner.os }}-cargo-${{ matrix.rust }}-${{ hashFiles('**/Cargo.lock') }}
+
+ - uses: actions-rs/toolchain@v1
+ with:
+ profile: minimal
+ toolchain: ${{ matrix.rust }}
+ override: true
+ components: rustfmt, clippy
+
+ - run: cargo test
+
+ - if: ${{ matrix.rust == 'stable' }}
+ run: cargo fmt --all -- --check
+
+ - if: ${{ matrix.rust == 'stable' }}
+ run: cargo clippy --all -- -D warnings
+
+ # Delete things that shouldn't be cached
+ - run: find ./target/debug -maxdepth 1 -type f -delete
+ - run: rm -rf ./target/debug/deps/tinytemplate*
+ - run: rm -rf ./target/debug/.fingerprint/tinytemplate*
+ - run: rm -f ./target/.rustc_info.json
+ - run: rm -rf ~/.cargo/registry/index/