Skip to content

Commit

Permalink
tests: Increase code coverage. (#381)
Browse files Browse the repository at this point in the history
* Add cargo caching to workflow.

* Add some tests.

* Add keep alive to webhooks.

* Fix serializing.

* Bubble up field.

* Clean up yaml handling.

* More fixes.

* Add webhook tests.
  • Loading branch information
milesj committed Oct 20, 2022
1 parent daf3b1b commit 6c3e012
Show file tree
Hide file tree
Showing 29 changed files with 647 additions and 336 deletions.
10 changes: 1 addition & 9 deletions .github/workflows/moon.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,6 @@ jobs:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: actions/cache@v3
name: Cache cargo
with:
path: |
~/.cargo/bin
~/.cargo/registry
~/.cargo/git
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
restore-keys: ${{ runner.os }}-cargo-
- uses: actions/cache@v3
name: Cache node modules
with:
Expand All @@ -54,6 +45,7 @@ jobs:
with:
toolchain: 1.64.0
profile: minimal
- uses: Swatinem/rust-cache@v2
- uses: moonrepo/tool-version-action@v1
with:
node: ${{ matrix.node-version }}
Expand Down
21 changes: 2 additions & 19 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -72,23 +72,14 @@ jobs:
runs-on: ${{ matrix.host }}
steps:
- uses: actions/checkout@v3
- uses: actions/cache@v3
name: Cache cargo
if: ${{ !matrix.docker-target }}
with:
path: |
~/.cargo/bin
~/.cargo/registry
~/.cargo/git
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
restore-keys: ${{ runner.os }}-cargo-
- uses: actions-rs/toolchain@v1
if: ${{ !matrix.docker-target }}
with:
override: true
profile: minimal
target: ${{ matrix.target }}
toolchain: stable
- uses: Swatinem/rust-cache@v2
- name: Generate lockfile
uses: actions-rs/cargo@v1
if: ${{ !matrix.docker-target }}
Expand Down Expand Up @@ -167,15 +158,7 @@ jobs:
cache: yarn
check-latest: true
node-version: 16
- uses: actions/cache@v3
name: Cache cargo
with:
path: |
~/.cargo/bin
~/.cargo/registry
~/.cargo/git
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
restore-keys: ${{ runner.os }}-cargo-
- uses: Swatinem/rust-cache@v2
- name: Setup toolchain
if: ${{ matrix.setup }}
run: ${{ matrix.setup }}
Expand Down
30 changes: 3 additions & 27 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,21 +22,13 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/cache@v3
name: Cache cargo
with:
path: |
~/.cargo/bin
~/.cargo/registry
~/.cargo/git
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
restore-keys: ${{ runner.os }}-cargo-
- uses: actions-rs/toolchain@v1
name: Setup toolchain
with:
toolchain: 1.64.0
profile: minimal
components: rustfmt
- uses: Swatinem/rust-cache@v2
- uses: actions-rs/cargo@v1
name: Check formatting
with:
Expand All @@ -51,21 +43,13 @@ jobs:
fail-fast: false
steps:
- uses: actions/checkout@v3
- uses: actions/cache@v3
name: Cache cargo
with:
path: |
~/.cargo/bin
~/.cargo/registry
~/.cargo/git
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
restore-keys: ${{ runner.os }}-cargo-
- uses: actions-rs/toolchain@v1
name: Setup toolchain
with:
toolchain: 1.64.0
profile: minimal
components: clippy
- uses: Swatinem/rust-cache@v2
- uses: davidB/rust-cargo-make@v1
- name: Run linter
run: cargo make lint
Expand All @@ -78,21 +62,13 @@ jobs:
fail-fast: false
steps:
- uses: actions/checkout@v3
- uses: actions/cache@v3
name: Cache cargo
with:
path: |
~/.cargo/bin
~/.cargo/registry
~/.cargo/git
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
restore-keys: ${{ runner.os }}-cargo-
- uses: actions-rs/toolchain@v1
name: Setup toolchain
with:
toolchain: 1.64.0
profile: minimal
components: llvm-tools-preview
- uses: Swatinem/rust-cache@v2
- uses: davidB/rust-cargo-make@v1
- uses: actions-rs/cargo@v1
if: ${{ runner.os != 'Windows' && env.WITH_COVERAGE == 'true' }}
Expand Down
Loading

0 comments on commit 6c3e012

Please sign in to comment.