-
Notifications
You must be signed in to change notification settings - Fork 0
70 lines (58 loc) · 1.76 KB
/
cicd.yaml
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:
workflow_dispatch:
push:
paths: [".cargo/**", "src/**", "tests/**", "Cargo.*", "CHANGELOG*"]
branches: [main]
pull_request:
# https://github.com/orgs/community/discussions/25161#discussioncomment-3246673
paths: [".cargo/**", "src/**", "tests/**", "Cargo.*", "CHANGELOG*"]
branches: [main]
defaults:
run:
shell: bash
jobs:
release_please:
name: Release please
if: ${{ !contains(github.event_name, 'workflow_dispatch') }}
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
outputs:
created: ${{ steps.release.outputs.release_created }}
tag_name: ${{ steps.release.outputs.tag_name }}
steps:
- uses: google-github-actions/release-please-action@v3
id: release
with:
release-type: rust
prerelease: true
ci:
name: Patrol
needs: [release_please]
if: ${{ !failure() && !cancelled() && !needs.release_please.outputs.created }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [macos-latest, ubuntu-latest, windows-latest]
steps:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
- name: Prexec
run: |
########## script ##########
case "${{ matrix.os }}" in
*'windows'*)
echo "OPENSSL_SRC_PERL=C:/Strawberry/perl/bin/perl" | tee -a "$GITHUB_ENV"
;;
esac
cargo update
- name: Run tests
run: cargo test --all-features --workspace
- name: Formatting check
run: cargo fmt --all --check
- name: Clippy check
run: cargo clippy --all-targets --all-features --workspace -- -D warnings