-
Notifications
You must be signed in to change notification settings - Fork 0
72 lines (63 loc) · 2.06 KB
/
Copy pathbuild.yml
File metadata and controls
72 lines (63 loc) · 2.06 KB
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
name: Ubuntu build
on:
push:
branches:
- main
tags:
- v*.*.*
pull_request:
branches:
- main
- '*/*'
- 'update_flake_lock_action'
schedule:
- cron: '0 0 * * 1'
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
build:
strategy:
matrix:
flags:
# no flags set, default to async-std
- ""
# crates that explicitly choose async-std should keep working
- --cfg async_executor_impl=\"async-std\" --cfg async_channel_impl=\"async-std\"
- --cfg async_executor_impl=\"async-std\" --cfg async_channel_impl=\"flume\"
- --cfg async_executor_impl=\"tokio\" --cfg async_channel_impl=\"tokio\"
- --cfg async_executor_impl=\"tokio\" --cfg async_channel_impl=\"flume\"
runs-on: ubuntu-latest
timeout-minutes: 60
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- uses: Swatinem/rust-cache@v2
name: Enable Rust Caching
- name: Format
run: |
cargo fmt -- --check
- name: Build
run: |
RUSTFLAGS="${{ matrix.flags }}" cargo build --all-targets --workspace --release --features="logging-utils"
- name: Test
run: |
RUSTFLAGS="${{ matrix.flags }}" cargo test --all-targets --workspace --release --features="logging-utils"
- name: Lint
run: |
RUSTFLAGS="${{ matrix.flags }}" cargo clippy --workspace --all-targets --bins --tests --examples --features="logging-utils" -- -D warnings
publish:
needs:
- build
runs-on: ubuntu-latest
env:
RUST_LOG: info
steps:
- uses: actions/checkout@v4
- uses: katyo/publish-crates@v2
with:
# Only do an actual publish if this is a push to a release tag. Otherwise, do a dry run.
dry-run: ${{ !(github.event_name == 'push' && github.ref_type == 'tag') }}
ignore-unpublished-changes: true
registry-token: ${{ secrets.CARGO_REGISTRY_TOKEN }}