Skip to content

Commit

Permalink
Update release and daily workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
nwagner84 committed Sep 24, 2023
1 parent 72944ec commit 4e38322
Show file tree
Hide file tree
Showing 3 changed files with 54 additions and 81 deletions.
46 changes: 23 additions & 23 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ jobs:
- uses: dtolnay/rust-toolchain@nightly
- name: "Install cargo-fuzz"
run: |
cargo install cargo-fuzz
cargo install -f cargo-fuzz
- run: |
cargo fuzz run --fuzz-dir ${{ matrix.item.fuzz-dir }} --jobs 2 ${{ matrix.item.target }} -- -max_total_time=${{ matrix.item.max-total-time }}
Expand Down Expand Up @@ -187,28 +187,28 @@ jobs:
- run: |
cargo clippy --workspace -- -D warnings -D rust-2021-compatibility -W unreachable-pub
udeps:
if: ${{ github.event_name == 'push' || !github.event.pull_request.draft }}
runs-on: ubuntu-latest
needs: test
steps:
- uses: actions/checkout@v4
- uses: abbbi/github-actions-tune@v1
- uses: actions/cache@v3
with:
key: ${{ env.CACHE_KEY }}-${{ hashFiles('**/Cargo.toml') }}
path: |
~/.cargo/bin/
~/.cargo/git/db/
~/.cargo/registry/cache/
~/.cargo/registry/index/
target/
- uses: dtolnay/rust-toolchain@nightly
- name: "Install `cargo-udeps`"
run: |
cargo install -f cargo-udeps
- run: |
cargo udeps --workspace
# udeps:
# if: ${{ github.event_name == 'push' || !github.event.pull_request.draft }}
# runs-on: ubuntu-latest
# needs: test
# steps:
# - uses: actions/checkout@v4
# - uses: abbbi/github-actions-tune@v1
# - uses: actions/cache@v3
# with:
# key: ${{ env.CACHE_KEY }}-${{ hashFiles('**/Cargo.toml') }}
# path: |
# ~/.cargo/bin/
# ~/.cargo/git/db/
# ~/.cargo/registry/cache/
# ~/.cargo/registry/index/
# target/
# - uses: dtolnay/rust-toolchain@nightly
# - name: "Install `cargo-udeps`"
# run: |
# cargo install -f cargo-udeps
# - run: |
# cargo udeps --workspace

audit:
if: ${{ github.ref == 'refs/heads/main' }}
Expand Down
22 changes: 8 additions & 14 deletions .github/workflows/daily.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ jobs:
audit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: actions/checkout@v4
- uses: abbbi/github-actions-tune@v1
- uses: actions/cache@v2
- uses: actions/cache@v3
with:
key: ${{ runner.os }}-cargo-stable-${{ hashFiles('**/Cargo.toml') }}
path: |
Expand All @@ -20,20 +20,17 @@ jobs:
~/.cargo/registry/cache/
~/.cargo/registry/index/
target/
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true
- uses: dtolnay/rust-toolchain@stable
- uses: actions-rs/audit-check@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}

upgrades:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: abbbi/github-actions-tune@v1
- uses: actions/cache@v2
- uses: actions/cache@v3
with:
key: ${{ env.CACHE_KEY }}-${{ hashFiles('**/Cargo.toml') }}
path: |
Expand All @@ -42,12 +39,9 @@ jobs:
~/.cargo/registry/cache/
~/.cargo/registry/index/
target/
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: nightly
override: true
- run: |
- uses: dtolnay/rust-toolchain@stable
- name: "Install `cargo-upgrades`"
run: |
cargo install -f cargo-upgrades
- run: |
cargo upgrades
67 changes: 23 additions & 44 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@ on:
- 'v*'

env:
# RUSTFLAGS: -D warnings -W unreachable-pub -W rust-2021-compatibility
RUSTFLAGS: -D warnings -W rust-2021-compatibility
RUSTFLAGS: -D warnings -W unreachable-pub -W rust-2021-compatibility
RUSTUP_MAX_RETRIES: 10
CARGO_INCREMENTAL: 0

Expand Down Expand Up @@ -42,8 +41,8 @@ jobs:
steps:
- name: "Print glibc version"
run: ldd --version
- uses: actions/checkout@v3
- uses: actions/cache@v2
- uses: actions/checkout@v4
- uses: actions/cache@v3
with:
key: ${{ runner.os }}-cargo-stable-${{ matrix.target.triple }}-glibc${{ matrix.target.glibc }}-${{ hashFiles('**/Cargo.toml') }}
path: |
Expand All @@ -61,22 +60,15 @@ jobs:
- name: "Install packages (CentOS)"
if: ${{ startsWith(matrix.target.image, 'centos') }}
run: yum install gcc -y
- uses: actions-rs/toolchain@v1
- uses: dtolnay/rust-toolchain@master
with:
toolchain: stable
target: ${{ matrix.target.triple }}
profile: minimal
override: true
- uses: actions-rs/cargo@v1
with:
command: build
args: --release --workspace
- name: "Run prepare tests"
run: ci/prepare-tests.sh
- uses: actions-rs/cargo@v1
with:
command: test
args: --release --workspace
- run: |
cargo build --release --workspace
cargo test --release --workspace
- name: "Strip release binary"
run: |
# strip target/release/pica-lint
Expand Down Expand Up @@ -111,8 +103,8 @@ jobs:
- { triple: x86_64-pc-windows-msvc, variant: "MSVC" }
- { triple: x86_64-pc-windows-gnu, variant: "GNU" }
steps:
- uses: actions/checkout@v3
- uses: actions/cache@v2
- uses: actions/checkout@v4
- uses: actions/cache@v3
with:
key: ${{ runner.os }}-cargo-stable-${{ matrix.target.triple }}-${{ hashFiles('**/Cargo.toml') }}
path: |
Expand All @@ -121,22 +113,16 @@ jobs:
~/.cargo/registry/cache/
~/.cargo/registry/index/
target/
- uses: actions-rs/toolchain@v1
- uses: dtolnay/rust-toolchain@master
with:
toolchain: stable
target: ${{ matrix.target.triple }}
profile: minimal
override: true
- uses: actions-rs/cargo@v1
with:
command: build
args: --release --workspace
- name: "Run prepare tests"
run: ci/prepare-tests.sh
- uses: actions-rs/cargo@v1
with:
command: test
args: --release --workspace
- run: |
cargo build --release --workspace
cargo test --release --workspace
- name: "Build release archive"
id: build-archive
shell: bash
Expand All @@ -163,8 +149,8 @@ jobs:
target:
- { triple: x86_64-apple-darwin }
steps:
- uses: actions/checkout@v3
- uses: actions/cache@v2
- uses: actions/checkout@v4
- uses: actions/cache@v3
with:
key: ${{ runner.os }}-cargo-stable-${{ matrix.target.triple }}-${{ hashFiles('**/Cargo.toml') }}
path: |
Expand All @@ -173,23 +159,16 @@ jobs:
~/.cargo/registry/cache/
~/.cargo/registry/index/
target/
- name: Install Rust
uses: actions-rs/toolchain@v1
- uses: dtolnay/rust-toolchain@master
with:
toolchain: stable
target: ${{ matrix.target.triple }}
profile: minimal
override: true
- uses: actions-rs/cargo@v1
with:
command: build
args: --release --workspace
- name: "Run prepare tests"
run: ci/prepare-tests.sh
- uses: actions-rs/cargo@v1
with:
command: test
args: --release --workspace
- run: |
cargo build --release --workspace
cargo test --release --workspace
- name: "Strip release binary"
run: |
strip target/release/pica-lint
Expand Down Expand Up @@ -226,9 +205,9 @@ jobs:
- { triple: x86_64-unknown-linux-gnu, glibc: 2.35, format: deb }
- { triple: x86_64-unknown-linux-gnu, glibc: 2.35, format: rpm }
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Download binary release
uses: actions/download-artifact@v2
uses: actions/download-artifact@v3
with:
name: pica-${{ needs.version.outputs.VERSION }}-${{ matrix.target.triple }}-glibc${{ matrix.target.glibc }}.tar.gz
- name: Extract binary release
Expand All @@ -243,7 +222,7 @@ jobs:
arch: x86_64
format: ${{ matrix.target.format }}
package: .github/actions-rs/package.yaml
- uses: actions/upload-artifact@v2
- uses: actions/upload-artifact@v3
with:
name: ${{ steps.build_rpm.outputs.package }}
path: ${{ steps.build_rpm.outputs.package }}
Expand Down Expand Up @@ -305,7 +284,7 @@ jobs:
- version
steps:
- name: "Download releases/packages"
uses: actions/download-artifact@v2
uses: actions/download-artifact@v3
- name: Assemble data
run: |
mkdir uploads/
Expand Down

0 comments on commit 4e38322

Please sign in to comment.