Skip to content

Commit 98cda24

Browse files
authored
Merge pull request #22 from rust-amplify/develop
Chore tasks: CI and dependencies update, repo links fixup
2 parents 4f023e6 + f3a41b5 commit 98cda24

17 files changed

+241
-315
lines changed

.github/workflows/build.yml

+28-52
Original file line numberDiff line numberDiff line change
@@ -13,17 +13,17 @@ jobs:
1313
default:
1414
runs-on: ubuntu-latest
1515
steps:
16-
- uses: actions/checkout@v2
17-
- name: Install rust stable
18-
uses: actions-rs/toolchain@v1
19-
with:
20-
toolchain: stable
21-
override: true
22-
- name: Default build
23-
uses: actions-rs/cargo@v1
24-
with:
25-
command: check
26-
args: --workspace
16+
- uses: actions/checkout@v4
17+
- uses: dtolnay/rust-toolchain@stable
18+
- run: cargo check
19+
no-default:
20+
runs-on: ubuntu-latest
21+
steps:
22+
- uses: actions/checkout@v4
23+
- uses: dtolnay/rust-toolchain@stable
24+
# NB: we have to use either std or alloc here
25+
- run: cargo check --no-default-features --features std
26+
- run: cargo check --no-default-features --features alloc
2727
features:
2828
runs-on: ubuntu-latest
2929
strategy:
@@ -37,57 +37,33 @@ jobs:
3737
- hex,alloc
3838
- hex,std
3939
steps:
40-
- uses: actions/checkout@v2
41-
- name: Install rust stable
42-
uses: actions-rs/toolchain@v1
43-
with:
44-
toolchain: stable
45-
override: true
46-
- name: Feature ${{ matrix.feature }}
47-
uses: actions-rs/cargo@v1
48-
with:
49-
command: check
50-
args: --no-default-features --features=${{ matrix.feature }}
51-
- name: Defaults + ${{ matrix.feature }}
52-
uses: actions-rs/cargo@v1
53-
with:
54-
command: check
55-
args: --features=${{ matrix.feature }}
40+
- uses: actions/checkout@v4
41+
- uses: dtolnay/rust-toolchain@stable
42+
- name: Feature ${{matrix.feature}}
43+
run: cargo check --no-default-features --features=${{matrix.feature}}
44+
- name: Feature ${{matrix.feature}}
45+
run: cargo check --features=${{matrix.feature}}
5646
platforms:
5747
runs-on: ${{ matrix.os }}
5848
strategy:
5949
fail-fast: false
6050
matrix:
61-
os: [ ubuntu-20.04, ubuntu-22.04, macos-11, macos-12, windows-2019, windows-2022 ]
51+
os: [ ubuntu-22.04, ubuntu-latest, macos-13, macos-latest, windows-2019, windows-latest ]
6252
steps:
63-
- uses: actions/checkout@v2
64-
- name: Install rust stable
65-
uses: actions-rs/toolchain@v1
66-
with:
67-
toolchain: stable
68-
override: true
69-
- name: Build with all features
70-
uses: actions-rs/cargo@v1
71-
with:
72-
command: check
73-
args: --workspace --all-targets --all-features
53+
- uses: actions/checkout@v4
54+
- uses: dtolnay/rust-toolchain@stable
55+
- name: Platform ${{matrix.os}}
56+
run: cargo check --workspace --all-features # we skip test targets here to be sure that the main library can be built
7457
toolchains:
7558
runs-on: ubuntu-latest
7659
strategy:
60+
fail-fast: false
7761
matrix:
78-
toolchain: [ nightly, beta, stable, 1.60.0 ]
62+
toolchain: [ nightly, beta, stable, 1.61.0 ]
7963
steps:
80-
- uses: actions/checkout@v2
81-
- name: Install rust ${{matrix.toolchain}}
82-
uses: actions-rs/toolchain@v1
64+
- uses: actions/checkout@v4
65+
- uses: dtolnay/rust-toolchain@master
8366
with:
8467
toolchain: ${{matrix.toolchain}}
85-
override: true
86-
- uses: Swatinem/rust-cache@v2
87-
- name: All features
88-
uses: actions-rs/cargo@v1
89-
env:
90-
RUSTFLAGS: "--cfg bench"
91-
with:
92-
command: check
93-
args: --workspace --all-targets --all-features
68+
- name: Toolchain ${{matrix.toolchain}}
69+
run: cargo +${{matrix.toolchain}} check --workspace --all-targets --all-features

.github/workflows/codecov.yml

+17-21
Original file line numberDiff line numberDiff line change
@@ -13,26 +13,22 @@ jobs:
1313
codecov:
1414
runs-on: ubuntu-latest
1515
steps:
16-
- uses: actions/checkout@v2
17-
- name: Install rust nightly
18-
uses: actions-rs/toolchain@v1
16+
- uses: actions/checkout@v4
17+
- uses: dtolnay/rust-toolchain@nightly
1918
with:
20-
toolchain: nightly
21-
override: true
22-
- name: Build & test
23-
uses: actions-rs/cargo@v1
19+
components: llvm-tools-preview
20+
- uses: taiki-e/install-action@cargo-llvm-cov
21+
- uses: taiki-e/install-action@nextest
22+
- name: Collect coverage data (including doctests)
23+
run: |
24+
cargo +nightly llvm-cov --no-report nextest --workspace --all-features
25+
cargo +nightly llvm-cov --no-report --doc --workspace --all-features
26+
cargo +nightly llvm-cov report --doctests --lcov --output-path lcov.info
27+
- name: Upload coverage data to codecov
28+
uses: codecov/codecov-action@v4
2429
with:
25-
command: test
26-
args: --workspace --all-features --no-fail-fast
27-
env:
28-
CARGO_INCREMENTAL: '0'
29-
RUSTFLAGS: '-Zprofile -Ccodegen-units=1 -Cinline-threshold=0 -Clink-dead-code -Coverflow-checks=off'
30-
RUSTDOCFLAGS: '-Zprofile -Ccodegen-units=1 -Cinline-threshold=0 -Clink-dead-code -Coverflow-checks=off'
31-
- id: coverage
32-
name: Generate coverage
33-
uses: actions-rs/[email protected]
34-
- name: Upload coverage to Codecov
35-
uses: codecov/codecov-action@v1
36-
with:
37-
file: ${{ steps.coverage.outputs.report }}
38-
directory: ./coverage/reports/
30+
flags: rust
31+
files: lcov.info
32+
fail_ci_if_error: true
33+
token: ${{ secrets.CODECOV_TOKEN }}
34+
verbose: true

.github/workflows/lint.yml

+12-30
Original file line numberDiff line numberDiff line change
@@ -13,45 +13,27 @@ jobs:
1313
fmt:
1414
runs-on: ubuntu-latest
1515
steps:
16-
- uses: actions/checkout@v2
17-
- name: Install rustc nightly
18-
uses: actions-rs/toolchain@v1
16+
- uses: actions/checkout@v4
17+
- uses: dtolnay/rust-toolchain@nightly
1918
with:
20-
toolchain: nightly
21-
override: true
2219
components: rustfmt
23-
- uses: actions-rs/cargo@v1
24-
name: Formatting
25-
with:
26-
command: fmt
27-
args: --all -- --check
20+
- name: Formatting
21+
run: cargo +nightly fmt --all -- --check
2822
clippy:
2923
runs-on: ubuntu-latest
3024
steps:
31-
- uses: actions/checkout@v2
32-
- name: Install rustc stable
33-
uses: actions-rs/toolchain@v1
25+
- uses: actions/checkout@v4
26+
- uses: dtolnay/rust-toolchain@stable
3427
with:
35-
toolchain: stable
36-
override: true
3728
components: clippy
38-
- uses: actions-rs/cargo@v1
39-
name: Clippy
40-
with:
41-
command: clippy
42-
args: --workspace --all-features
29+
- name: Formatting
30+
run: cargo clippy --workspace --all-features --all-targets -- -D warnings
4331
doc:
4432
runs-on: ubuntu-latest
4533
steps:
46-
- uses: actions/checkout@v2
47-
- name: Install rustc nightly
48-
uses: actions-rs/toolchain@v1
34+
- uses: actions/checkout@v4
35+
- uses: dtolnay/rust-toolchain@nightly
4936
with:
50-
toolchain: nightly
51-
override: true
5237
components: rust-docs
53-
- uses: actions-rs/cargo@v1
54-
name: Doc
55-
with:
56-
command: doc
57-
args: --workspace --all-features
38+
- name: Formatting
39+
run: cargo +nightly doc --workspace --all-features

.github/workflows/test.yml

+18-25
Original file line numberDiff line numberDiff line change
@@ -11,34 +11,27 @@ env:
1111

1212
jobs:
1313
testing:
14-
runs-on: ubuntu-latest
14+
runs-on: ${{ matrix.os }}
15+
strategy:
16+
fail-fast: false
17+
matrix:
18+
os: [ ubuntu-latest, macos-13, macos-latest, windows-latest ]
1519
steps:
16-
- uses: actions/checkout@v2
17-
- name: Install rust nightly
18-
uses: actions-rs/toolchain@v1
19-
with:
20-
toolchain: nightly
21-
override: true
22-
- uses: Swatinem/rust-cache@v2
23-
- name: Build & test
24-
uses: actions-rs/cargo@v1
25-
with:
26-
command: test
27-
args: --workspace --all-features --no-fail-fast
20+
- uses: actions/checkout@v4
21+
- uses: dtolnay/rust-toolchain@stable
22+
- name: Test ${{matrix.os}}
23+
run: cargo test --workspace --all-features --no-fail-fast
2824
wasm-testing:
2925
runs-on: ubuntu-latest
26+
strategy:
27+
fail-fast: false
28+
matrix:
29+
package: [ apfloat, num ]
3030
steps:
31-
- uses: actions/checkout@v2
32-
- name: Install rust nightly
33-
uses: actions-rs/toolchain@v1
34-
with:
35-
toolchain: nightly
36-
override: true
37-
- uses: Swatinem/rust-cache@v2
38-
- uses: jetli/[email protected]
31+
- uses: actions/checkout@v4
32+
- uses: dtolnay/rust-toolchain@nightly
33+
- uses: jetli/[email protected]
3934
- name: Add wasm32 target
4035
run: rustup target add wasm32-unknown-unknown
41-
- name: Test apfloat
42-
run: cd apfloat && wasm-pack test --headless --chrome --all-features
43-
- name: Test num
44-
run: cd num && wasm-pack test --headless --chrome --all-features
36+
- name: Test in headless Chrome
37+
run: wasm-pack test --headless --chrome ${{matrix.package}} --all-features

.rustfmt.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ fn_call_width = 100
99
format_code_in_doc_comments = true
1010
fn_single_line = true
1111
format_macro_matchers = true
12-
format_macro_bodues = true
12+
format_macro_bodies = true
1313
format_strings = true
1414
merge_derives = false
1515
overflow_delimited_expr = true

0 commit comments

Comments
 (0)