Skip to content

Update Rust to v1.83.0 #401

Update Rust to v1.83.0

Update Rust to v1.83.0 #401

Workflow file for this run

name: CI
on:
push:
branches:
- main
pull_request:
concurrency:
group: ci-${{ github.head_ref || github.ref }}
cancel-in-progress: true
env:
CARGO_TERM_COLOR: always
# renovate: datasource=crate depName=cargo-deny versioning=semver
CARGO_DENY_VERSION: 0.16.1
# renovate: datasource=docker depName=postgres
POSTGRES_VERSION: 16
jobs:
changed-files:
name: Changed Files
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- uses: tj-actions/changed-files@4edd678ac3f81e2dc578756871e4d00c19191daf # v45.0.4
id: changed-files-rust
with:
files: |
migrations/**
src/**
Cargo.lock
Cargo.toml
rust-toolchain.toml
- uses: tj-actions/changed-files@4edd678ac3f81e2dc578756871e4d00c19191daf # v45.0.4
id: changed-files-rust-lockfile
with:
files: Cargo.lock
outputs:
rust: ${{ steps.changed-files-rust.outputs.any_modified }}
rust-lockfile: ${{ steps.changed-files-rust-lockfile.outputs.any_modified }}
lint:
name: Lint
runs-on: ubuntu-24.04
needs: changed-files
if: needs.changed-files.outputs.rust == 'true'
env:
RUSTFLAGS: "-D warnings"
RUSTDOCFLAGS: "-D warnings"
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- run: rustup component add rustfmt
- run: rustup component add clippy
- uses: Swatinem/rust-cache@82a92a6e8fbeee089604da2575dc567ae9ddeaab # v2.7.5
- run: cargo fmt --check --all
- run: cargo clippy --all-targets --all-features --workspace
- run: cargo doc --no-deps --document-private-items
# cargo-deny:
# name: cargo-deny
# runs-on: ubuntu-24.04
# needs: changed-files
# if: github.event_name != 'pull_request' || needs.changed-files.outputs.rust-lockfile == 'true'
#
# steps:
# - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
#
# - uses: Swatinem/rust-cache@82a92a6e8fbeee089604da2575dc567ae9ddeaab # v2.7.5
#
# - run: cargo install cargo-deny --vers ${{ env.CARGO_DENY_VERSION }}
# - run: cargo deny check
# test:
# name: Test
# runs-on: ubuntu-24.04
# needs: changed-files
# if: needs.changed-files.outputs.rust == 'true'
#
# env:
# RUST_BACKTRACE: 1
# TEST_DATABASE_URL: postgres://postgres:postgres@localhost/postgres
# RUSTFLAGS: "-D warnings -Cinstrument-coverage"
# MALLOC_CONF: "background_thread:true,abort_conf:true,abort:true,junk:true"
# CARGO_TARGET_DIR: /mnt/target
#
# steps:
# - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
# - uses: Swatinem/rust-cache@82a92a6e8fbeee089604da2575dc567ae9ddeaab # v2.7.5
# with:
# # Ensure that we cache from the right target directory. (See below
# # for the details of how and when this gets created.)
# workspaces: '. -> ${{ env.CARGO_TARGET_DIR }}'
#
# # Update `pg_dump` to the same version as the running PostgreSQL server
# - run: sudo /usr/share/postgresql-common/pgdg/apt.postgresql.org.sh -v ${{ env.POSTGRES_VERSION }} -i -p
# - run: sudo systemctl start postgresql.service
# - run: sudo -u postgres psql -c "ALTER USER postgres WITH PASSWORD 'postgres'"
#
# # Create a working directory on /mnt, which is a larger temporary
# # filesystem than /, that we can then point our later commands to.
# - run: |
# sudo mkdir ${{ env.CARGO_TARGET_DIR }}
# sudo chown $(id -u):$(id -g) ${{ env.CARGO_TARGET_DIR }}
#
# - run: cargo build --tests --workspace
# - run: cargo test --workspace
#
# - run: curl -sL https://github.com/mozilla/grcov/releases/download/v${{ env.GRCOV_VERSION }}/grcov-x86_64-unknown-linux-gnu.tar.bz2 | tar xjf -
# - run: rustup component add llvm-tools
# - run: ./grcov . --binary-path ${{ env.CARGO_TARGET_DIR }}/debug/ -s . -t lcov --branch --ignore-not-existing --ignore "/*" --ignore "${{ env.CARGO_TARGET_DIR }}/debug/build/**" -o ${{ env.CARGO_TARGET_DIR }}/coverage.lcov
#
# - uses: codecov/codecov-action@b9fd7d16f6d7d1b5d2bec1a2887e65ceed900238 # v4.6.0
# with:
# files: ${{ env.CARGO_TARGET_DIR }}/coverage.lcov
# env:
# CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}