Skip to content

Commit

Permalink
ci: work on CI
Browse files Browse the repository at this point in the history
  • Loading branch information
duesee committed Apr 13, 2024
1 parent 1b8511f commit 691d991
Show file tree
Hide file tree
Showing 10 changed files with 242 additions and 337 deletions.
7 changes: 5 additions & 2 deletions .github/actions/cache_restore/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,16 @@ runs:
steps:
- uses: actions/cache/restore@v4
with:
# See https://doc.rust-lang.org/cargo/guide/cargo-home.html#caching-the-cargo-home-in-ci
path: |
# See https://doc.rust-lang.org/cargo/guide/cargo-home.html#caching-the-cargo-home-in-ci
~/.cargo/.crates.toml
~/.cargo/.crates2.json
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
key: ${{ github.workflow }}
# See https://doc.rust-lang.org/cargo/guide/build-cache.html
target
key: branch|${{ runner.os }}|${{ github.job }}
restore-keys: main|${{ runner.os }}

6 changes: 4 additions & 2 deletions .github/actions/cache_save/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,15 @@ runs:
steps:
- uses: actions/cache/save@v4
with:
# See https://doc.rust-lang.org/cargo/guide/cargo-home.html#caching-the-cargo-home-in-ci
path: |
# See https://doc.rust-lang.org/cargo/guide/cargo-home.html#caching-the-cargo-home-in-ci
~/.cargo/.crates.toml
~/.cargo/.crates2.json
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
key: ${{ github.workflow }}
# See https://doc.rust-lang.org/cargo/guide/build-cache.html
target
key: branch|${{ runner.os }}|${{ github.job }}|${{ github.run_attempt }}

1 change: 1 addition & 0 deletions .github/workflows/audit.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
name: audit
on:
push:
branches: [ main ]
Expand Down
141 changes: 0 additions & 141 deletions .github/workflows/build_and_test.yml

This file was deleted.

25 changes: 25 additions & 0 deletions .github/workflows/cache.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: cache
on:
schedule:
# 21:43 on Wednesday and Sunday. (Thanks, crontab.guru)
- cron: '43 21 * * 3,0'
workflow_dispatch:

jobs:
create:
runs-on: ubuntu-latest

steps:
- run: cargo install just
- run: just install
- uses: actions/cache/save@v4
with:
path: |
# See https://doc.rust-lang.org/cargo/guide/cargo-home.html#caching-the-cargo-home-in-ci
~/.cargo/.crates.toml
~/.cargo/.crates2.json
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
key: main|${{ runner.os }}|${{ github.run_attempt }}
35 changes: 0 additions & 35 deletions .github/workflows/coverage.yml

This file was deleted.

81 changes: 81 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
name: main
on:
push:
branches: [ main ]
paths:
- "**.rs"
- "**.toml"
- ".github/workflows/**"
pull_request:
branches: [ main ]
paths:
- "**.rs"
- "**.toml"
- ".github/workflows/**"
workflow_dispatch:

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/cache_restore
- run: cargo install just
- run: just check
- uses: ./.github/actions/cache_save

test:
strategy:
matrix:
os: [ ubuntu-latest, macos-latest, windows-latest ]
runs-on: ${{ matrix.os }}

steps:
- uses: actions/checkout@v4

- uses: ./.github/actions/cache_restore
- run: cargo install just
- run: just test
- uses: ./.github/actions/cache_save

coverage:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- uses: ./.github/actions/cache_restore
- run: cargo install just
- run: just coverage
- uses: ./.github/actions/cache_save

- uses: coverallsapp/github-action@c203f016dd0ff7855ebef0ed852000c20c117148
with:
format: lcov
file: target/coverage/coverage.lcov

fuzz:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- uses: ./.github/actions/cache_restore
- run: cargo install just
- run: just fuzz
- uses: ./.github/actions/cache_save

minimal_versions:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- uses: ./.github/actions/cache_restore
- run: cargo install just
- run: just minimal_versions
- uses: ./.github/actions/cache_save

31 changes: 0 additions & 31 deletions .github/workflows/minimal_versions.yml

This file was deleted.

30 changes: 0 additions & 30 deletions .github/workflows/semver.yml

This file was deleted.

Loading

0 comments on commit 691d991

Please sign in to comment.