-
Notifications
You must be signed in to change notification settings - Fork 2
86 lines (77 loc) · 2.06 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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
name: CI
on:
push:
pull_request:
workflow_dispatch:
env:
API_KEY: ${{ secrets.API_KEY }}
RUST_BACKTRACE: 1
jobs:
pre_ci:
uses: dtolnay/.github/.github/workflows/pre_ci.yml@master
ensure_api_key_set:
needs: pre_ci
runs-on: ubuntu-latest
steps:
- if: ${{ env.API_KEY == '' }}
uses: actions/github-script@v7
with:
script: |
core.setFailed('API_KEY secret must be defined!')
test:
name: Rust ${{matrix.rust}} ${{matrix.os}}
needs: ensure_api_key_set
if: needs.pre_ci.outputs.continue
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
rust: [stable]
os: [ubuntu-latest, windows-latest, macos-latest]
include:
- os: ubuntu-latest
rust: nightly
- os: ubuntu-latest
rust: beta
- os: ubuntu-latest
rust: 1.71.0
steps:
- uses: actions/checkout@v4
- uses: ilammy/setup-nasm@v1
if: matrix.os == 'windows-latest'
- uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{matrix.rust}}
- run: cargo test
format:
name: Format Check And Linting
needs: pre_ci
runs-on: ubuntu-latest
if: github.event_name != 'pull_request'
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- run: cargo fmt -- --check
- run: cargo clippy
# outdated:
# name: Outdated
# needs: pre_ci
# runs-on: ubuntu-latest
# if: github.event_name != 'pull_request'
# steps:
# - uses: actions/checkout@v4
# - uses: dtolnay/rust-toolchain@stable
# - uses: dtolnay/install@cargo-outdated
# - run: cargo outdated --workspace --exit-code 1
doc:
name: Documentation
needs: pre_ci
if: needs.pre_ci.outputs.continue
runs-on: ubuntu-latest
env:
RUSTDOCFLAGS: -Dwarnings
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@nightly
- uses: dtolnay/install@cargo-docs-rs
- run: cargo docs-rs -p openweathermap_client