Skip to content

Commit

Permalink
Merge pull request #10176 from Turbo87/zizmor
Browse files Browse the repository at this point in the history
CI: Fix zizmor issues
  • Loading branch information
Turbo87 authored Dec 10, 2024
2 parents 46b963b + 4c4dfe2 commit 4b33fdd
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 7 deletions.
29 changes: 22 additions & 7 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ jobs:

steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
persist-credentials: false

- uses: tj-actions/changed-files@bab30c2299617f6615ec02a68b9a40d10bd21366 # v45.0.5
id: changed-files-non-js
Expand Down Expand Up @@ -97,6 +99,8 @@ jobs:

steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
persist-credentials: false

- run: rustup component add rustfmt
- run: rustup component add clippy
Expand All @@ -115,10 +119,12 @@ jobs:

steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
persist-credentials: false

- uses: Swatinem/rust-cache@82a92a6e8fbeee089604da2575dc567ae9ddeaab # v2.7.5

- run: cargo install cargo-deny --vers ${{ env.CARGO_DENY_VERSION }}
- run: cargo install cargo-deny --vers ${CARGO_DENY_VERSION}
- run: cargo deny check

backend-test:
Expand All @@ -136,33 +142,36 @@ jobs:

steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
persist-credentials: false

- 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 /usr/share/postgresql-common/pgdg/apt.postgresql.org.sh -v ${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 }}
sudo mkdir ${CARGO_TARGET_DIR}
sudo chown $(id -u):$(id -g) ${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: curl -sL https://github.com/mozilla/grcov/releases/download/v${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
- run: ./grcov . --binary-path ${CARGO_TARGET_DIR}/debug/ -s . -t lcov --branch --ignore-not-existing --ignore "/*" --ignore "${CARGO_TARGET_DIR}/debug/build/**" -o ${CARGO_TARGET_DIR}/coverage.lcov

- uses: codecov/codecov-action@7f8b4b4bde536c465e797be725718b88c5d95e0e # v5.1.1
with:
files: ${{ env.CARGO_TARGET_DIR }}/coverage.lcov
files: ${CARGO_TARGET_DIR}/coverage.lcov
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}

Expand All @@ -174,6 +183,8 @@ jobs:

steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
persist-credentials: false

- uses: pnpm/action-setup@fe02b34f77f8bc703788d5817da081398fad5dd2 # v4.0.0
with:
Expand Down Expand Up @@ -208,6 +219,8 @@ jobs:

steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
persist-credentials: false

- uses: pnpm/action-setup@fe02b34f77f8bc703788d5817da081398fad5dd2 # v4.0.0
with:
Expand Down Expand Up @@ -244,6 +257,8 @@ jobs:

steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
persist-credentials: false

- uses: pnpm/action-setup@fe02b34f77f8bc703788d5817da081398fad5dd2 # v4.0.0
with:
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/smoke-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ jobs:

steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
persist-credentials: false

- uses: Swatinem/rust-cache@82a92a6e8fbeee089604da2575dc567ae9ddeaab # v2.7.5
- run: cargo build --package crates_io_smoke_test
- run: cargo run --package crates_io_smoke_test --quiet
Expand Down

0 comments on commit 4b33fdd

Please sign in to comment.