diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 67ea65904..78bb988a8 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -28,9 +28,9 @@ jobs: check: 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: | @@ -39,16 +39,9 @@ jobs: ~/.cargo/registry/cache/ ~/.cargo/registry/index/ target/ - - uses: actions-rs/toolchain@v1 - with: - toolchain: nightly - target: x86_64-unknown-linux-gnu - profile: minimal - override: true - - uses: actions-rs/cargo@v1 - with: - command: check - args: --workspace + - uses: dtolnay/rust-toolchain@nightly + - run: | + make check test: name: test ${{ matrix.target.triple }} (${{ matrix.target.toolchain }}) @@ -66,10 +59,10 @@ jobs: - { os: windows-latest, toolchain: stable, triple: i686-pc-windows-msvc } runs-on: ${{ matrix.target.os }} steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: abbbi/github-actions-tune@v1 if: ${{ matrix.target.os == 'ubuntu-latest' }} - - uses: actions/cache@v2 + - uses: actions/cache@v3 with: key: ${{ runner.os }}-cargo-${{ matrix.target.toolchain }}-${{ matrix.target.triple }}-${{ hashFiles('**/Cargo.toml') }} path: | @@ -78,18 +71,14 @@ jobs: ~/.cargo/registry/cache/ ~/.cargo/registry/index/ target/ - - uses: actions-rs/toolchain@v1 + - uses: dtolnay/rust-toolchain@master with: toolchain: ${{ matrix.target.toolchain }} - target: ${{ matrix.target.triple }} - profile: minimal - override: true + targets: ${{ matrix.target.triple }} - name: "Run prepare tests" run: ci/prepare-tests.sh - - uses: actions-rs/cargo@v1 - with: - command: test - args: --workspace --all-features --no-fail-fast + - run: | + make test cross: if: ${{ github.event_name == 'push' || !github.event.pull_request.draft }} @@ -106,10 +95,10 @@ jobs: - { os: ubuntu-latest, toolchain: stable, triple: aarch64-unknown-linux-gnu } - { os: ubuntu-latest, toolchain: stable, triple: aarch64-unknown-linux-musl } steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: abbbi/github-actions-tune@v1 if: ${{ matrix.target.os == 'ubuntu-latest' }} - - uses: actions/cache@v2 + - uses: actions/cache@v3 with: key: ${{ runner.os }}-cargo-cross-${{ matrix.target.toolchain }}-${{ matrix.target.triple }}-${{ hashFiles('**/Cargo.toml') }} path: | @@ -118,17 +107,14 @@ jobs: ~/.cargo/registry/cache/ ~/.cargo/registry/index/ target/ - - uses: actions-rs/toolchain@v1 + - uses: dtolnay/rust-toolchain@master with: toolchain: ${{ matrix.target.toolchain }} - target: ${{ matrix.target.triple }} - profile: minimal - override: true - - uses: actions-rs/cargo@v1 - with: - use-cross: true - command: build - args: --workspace --all-features + targets: ${{ matrix.target.triple }} + - name: "Install cross" + run: cargo install -f cross + - run: | + cross build --target ${{ matrix.target.triple }} fuzz: if: ${{ github.event_name == 'push' || !github.event.pull_request.draft }} @@ -141,9 +127,9 @@ jobs: - { name: record_ref, fuzz-dir: crates/pica-record/fuzz, target: fuzz_record_ref, max-total-time: 300 } - { name: select_query, fuzz-dir: crates/pica-select/fuzz, target: fuzz_query, max-total-time: 300 } 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: | @@ -152,27 +138,20 @@ jobs: ~/.cargo/registry/cache/ ~/.cargo/registry/index/ target/ - - uses: actions-rs/toolchain@v1 - with: - profile: minimal - toolchain: nightly - override: true - - uses: actions-rs/install@v0.1 - with: - crate: cargo-fuzz - version: latest - - uses: actions-rs/cargo@v1 - with: - command: fuzz - args: run --fuzz-dir ${{ matrix.item.fuzz-dir }} --jobs 2 ${{ matrix.item.target }} -- -max_total_time=${{ matrix.item.max-total-time }} + - uses: dtolnay/rust-toolchain@nightly + - name: "Install cargo-fuzz" + run: | + 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 }} fmt: runs-on: ubuntu-latest needs: test 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: | @@ -181,24 +160,19 @@ jobs: ~/.cargo/registry/cache/ ~/.cargo/registry/index/ target/ - - uses: actions-rs/toolchain@v1 + - uses: dtolnay/rust-toolchain@nightly with: - profile: minimal - toolchain: nightly - override: true components: rustfmt - - uses: actions-rs/cargo@v1 - with: - command: fmt - args: --all -- --check + - run: | + cargo fmt --all -- --check clippy: runs-on: ubuntu-latest needs: test 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: | @@ -207,25 +181,20 @@ jobs: ~/.cargo/registry/cache/ ~/.cargo/registry/index/ target/ - - uses: actions-rs/toolchain@v1 + - uses: dtolnay/rust-toolchain@nightly with: - profile: minimal - toolchain: nightly - override: true components: clippy - - uses: actions-rs/cargo@v1 - with: - command: clippy - args: --workspace -- -D warnings -D rust-2021-compatibility -W unreachable-pub + - 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@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: | @@ -234,28 +203,21 @@ jobs: # ~/.cargo/registry/cache/ # ~/.cargo/registry/index/ # target/ - # - uses: actions-rs/toolchain@v1 - # with: - # profile: minimal - # toolchain: nightly - # override: true - # - uses: actions-rs/install@v0.1 - # with: - # crate: cargo-udeps - # version: latest - # - uses: actions-rs/cargo@v1 - # with: - # command: udeps - # args: --workspace + # - 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' }} runs-on: ubuntu-latest needs: test 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: | @@ -264,12 +226,8 @@ jobs: ~/.cargo/registry/cache/ ~/.cargo/registry/index/ target/ - - uses: actions-rs/toolchain@v1 - with: - profile: minimal - toolchain: nightly - override: true - - uses: actions-rs/audit-check@v1 + - uses: dtolnay/rust-toolchain@nightly + - uses: rustsec/audit-check@v1.4.1 with: token: ${{ secrets.GITHUB_TOKEN }} @@ -278,9 +236,9 @@ jobs: runs-on: ubuntu-latest needs: test 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: | @@ -289,15 +247,10 @@ jobs: ~/.cargo/registry/cache/ ~/.cargo/registry/index/ target/ - - uses: actions-rs/toolchain@v1 - with: - profile: minimal - toolchain: nightly - override: true - - uses: actions-rs/install@v0.1 - with: - crate: cargo-upgrades - version: latest + - uses: dtolnay/rust-toolchain@nightly + - name: "Install `cargo-upgrades`" + run: | + cargo install -f cargo-upgrades - run: | cargo upgrades @@ -305,9 +258,9 @@ jobs: runs-on: ubuntu-latest needs: test 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: | @@ -316,12 +269,7 @@ jobs: ~/.cargo/registry/cache/ ~/.cargo/registry/index/ target/ - - uses: actions-rs/toolchain@v1 - with: - profile: minimal - toolchain: nightly - override: true - components: clippy + - uses: dtolnay/rust-toolchain@nightly - uses: EmbarkStudios/cargo-deny-action@v1 with: log-level: warn @@ -334,9 +282,8 @@ jobs: needs: test steps: - name: Checkout repository - uses: actions/checkout@v3 - - name: Install Rust - uses: dtolnay/rust-toolchain@miri + uses: actions/checkout@v4 + - uses: dtolnay/rust-toolchain@miri - run: cargo miri test --workspace --lib --verbose env: MIRIFLAGS: -Zmiri-strict-provenance @@ -349,9 +296,9 @@ jobs: runs-on: ubuntu-latest needs: test 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: | @@ -360,15 +307,10 @@ jobs: ~/.cargo/registry/cache/ ~/.cargo/registry/index/ target/ - - uses: actions-rs/toolchain@v1 - with: - profile: minimal - toolchain: nightly - override: true - - uses: actions-rs/install@v0.1 - with: - version: latest - crate: mdbook + - uses: dtolnay/rust-toolchain@nightly + - name: "Install `mdbook`" + run: | + cargo install -f mdbook - run: | mdbook build docs/book mdbook test docs/book @@ -390,9 +332,9 @@ jobs: - 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: | @@ -401,15 +343,10 @@ jobs: ~/.cargo/registry/cache/ ~/.cargo/registry/index/ target/ - - uses: actions-rs/toolchain@v1 - with: - profile: minimal - toolchain: nightly - override: true - - uses: actions-rs/install@v0.1 - with: - version: latest - crate: mdbook + - uses: dtolnay/rust-toolchain@nightly + - name: "Install `mdbook`" + run: | + cargo install -f mdbook - run: | mkdir -p target/docs cargo doc --all --no-deps --workspace --target-dir target/docs/api diff --git a/.github/workflows/daily.yml b/.github/workflows/daily.yml index dbeb90a0a..8be0ef2f6 100644 --- a/.github/workflows/daily.yml +++ b/.github/workflows/daily.yml @@ -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: | @@ -20,20 +20,17 @@ jobs: ~/.cargo/registry/cache/ ~/.cargo/registry/index/ target/ - - uses: actions-rs/toolchain@v1 - with: - toolchain: stable - override: true - - uses: actions-rs/audit-check@v1 + - uses: dtolnay/rust-toolchain@stable + - uses: rustsec/audit-check@v1.4.1 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: | @@ -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 diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 9cfa355f6..7504a58d7 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -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 @@ -36,14 +35,14 @@ jobs: - { image: "ubuntu:22.04", triple: x86_64-unknown-linux-gnu, glibc: 2.35 } - { image: "ubuntu:20.04", triple: x86_64-unknown-linux-gnu, glibc: 2.31 } - { image: "debian:10", triple: x86_64-unknown-linux-gnu, glibc: 2.28 } - - { image: "centos:centos7", triple: x86_64-unknown-linux-gnu, glibc: 2.17 } + # - { image: "centos:centos7", triple: x86_64-unknown-linux-gnu, glibc: 2.17 } container: image: ${{ matrix.target.image }} 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: | @@ -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 @@ -95,7 +87,7 @@ jobs: tar cfvz "$staging.tar.gz" "$staging/" echo "filename=$staging.tar.gz" >> $GITHUB_OUTPUT echo "ASSET_PATH=$staging.tar.gz" >> $GITHUB_ENV - - uses: actions/upload-artifact@v2 + - uses: actions/upload-artifact@v3 with: name: ${{ env.ASSET_PATH }} path: ${{ env.ASSET_PATH }} @@ -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: | @@ -121,22 +113,15 @@ 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 @@ -148,7 +133,7 @@ jobs: cp "target/release/pica-lint.exe" "$staging/" 7z a "$staging.zip" "$staging/" echo "ASSET_PATH=$staging.zip" >> $GITHUB_ENV - - uses: actions/upload-artifact@v2 + - uses: actions/upload-artifact@v3 with: name: ${{ env.ASSET_PATH }} path: ${{ env.ASSET_PATH }} @@ -163,8 +148,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: | @@ -173,23 +158,15 @@ 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 @@ -204,7 +181,7 @@ jobs: cp "target/release/pica" "$staging/" tar cfvz "$staging.tar.gz" "$staging/" echo "ASSET_PATH=$staging.tar.gz" >> $GITHUB_ENV - - uses: actions/upload-artifact@v2 + - uses: actions/upload-artifact@v3 with: name: ${{ env.ASSET_PATH }} path: ${{ env.ASSET_PATH }} @@ -217,8 +194,8 @@ jobs: strategy: matrix: target: - - { triple: x86_64-unknown-linux-gnu, glibc: 2.17, format: deb } - - { triple: x86_64-unknown-linux-gnu, glibc: 2.17, format: rpm } + # - { triple: x86_64-unknown-linux-gnu, glibc: 2.17, format: deb } + # - { triple: x86_64-unknown-linux-gnu, glibc: 2.17, format: rpm } - { triple: x86_64-unknown-linux-gnu, glibc: 2.28, format: deb } - { triple: x86_64-unknown-linux-gnu, glibc: 2.28, format: rpm } - { triple: x86_64-unknown-linux-gnu, glibc: 2.31, format: deb } @@ -226,9 +203,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 @@ -243,7 +220,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 }} @@ -262,17 +239,17 @@ jobs: - { name: "Ubuntu 22.04", image: "ubuntu:22.04", glibc: 2.35 } - { name: "Ubuntu 21.10", image: "ubuntu:21.10", glibc: 2.35 } - { name: "Ubuntu 20.04", image: "ubuntu:20.04", glibc: 2.31 } - - { name: "CentOS 7", image: "centos:7", glibc: 2.17 } + # - { name: "CentOS 7", image: "centos:7", glibc: 2.17 } - { name: "CentOS 8", image: "centos:8", glibc: 2.28 } steps: - name: "Download Package (DEB)" if: ${{ !startsWith(matrix.target.name, 'CentOS') }} - uses: actions/download-artifact@v2 + uses: actions/download-artifact@v3 with: name: pica_${{ needs.version.outputs.VERSION }}-glibc${{ matrix.target.glibc}}-1_amd64.deb - name: "Download Package (RPM)" if: ${{ startsWith(matrix.target.name, 'CentOS') }} - uses: actions/download-artifact@v2 + uses: actions/download-artifact@v3 with: name: pica-${{ needs.version.outputs.VERSION }}-glibc${{ matrix.target.glibc }}-1.x86_64.rpm - name: Fix CentoOS8 @@ -305,7 +282,7 @@ jobs: - version steps: - name: "Download releases/packages" - uses: actions/download-artifact@v2 + uses: actions/download-artifact@v3 - name: Assemble data run: | mkdir uploads/ diff --git a/Makefile b/Makefile new file mode 100644 index 000000000..80395386d --- /dev/null +++ b/Makefile @@ -0,0 +1,9 @@ +CARGO ?= cargo + +.PHONY: check +check: + $(CARGO) check --workspace --all-features + +.PHONY: test +test: + $(CARGO) test --workspace --all-features --no-fail-fast diff --git a/docs/book/src/anleitungen/installation.md b/docs/book/src/anleitungen/installation.md index c32cb661c..38c47f7b4 100644 --- a/docs/book/src/anleitungen/installation.md +++ b/docs/book/src/anleitungen/installation.md @@ -25,11 +25,6 @@ Download bereit. Diese können mit folgendem Kommando installiert werden: $ rpm -i pica-0.20.0-glibc2.35-1.x86_64.rpm ``` -Für altere Distributionen (bspw. CentOS 7) stehen spezielle `RPM`-Pakete -bereit, die eine ältere Version der -[GNU C Library (glibc)](https://www.gnu.org/software/libc) verwenden -(`2.17` und `2.31`). - ## Binary-Releases Für die Betriebssysteme Linux, macOS und Windows stehen mit jeder neuen Version Binaries zum