forked from denoland/deno_doc
-
Notifications
You must be signed in to change notification settings - Fork 0
69 lines (57 loc) · 1.77 KB
/
ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
name: ci
on: [push, pull_request]
jobs:
rust:
name: deno_doc-${{ matrix.os }}
if: |
github.event_name == 'push' ||
!startsWith(github.event.pull_request.head.label, 'denoland:')
runs-on: ${{ matrix.os }}
timeout-minutes: 30
strategy:
matrix:
os: [macOS-latest, ubuntu-16.04, windows-2019]
steps:
- name: Clone repository
uses: actions/checkout@v2
with:
submodules: true
- name: Install rust
uses: hecrj/[email protected]
with:
rust-version: 1.54.0
- name: Install clippy and rustfmt
run: |
rustup component add clippy
rustup component add rustfmt
- name: Cache
uses: actions/cache@v2
with:
path: |
~/.cargo/registry
~/.cargo/git
target/
key: ${{ runner.os }}-${{ github.sha }}
restore-keys: ${{ runner.os }}-
- name: Environment
run: |
echo "GH_ACTIONS=1" >> ${GITHUB_ENV}
echo "RUST_BACKTRACE=full" >> ${GITHUB_ENV}
- name: Format
if: contains(matrix.os, 'ubuntu')
run: rustfmt --check src/lib.rs
- name: Build
run: cargo build --locked --release --all-targets --all-features
- name: Test
run: cargo test --locked --release --all-targets --all-features
- name: Lint
run: cargo clippy --all-targets --all-features --release --locked -- -D clippy::all
- name: Publish
if: |
contains(matrix.os, 'ubuntu') &&
github.repository == 'denoland/deno_doc' &&
startsWith(github.ref, 'refs/tags/')
env:
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
run: |
cargo publish -vv