Skip to content

Commit

Permalink
Solve CI warnings replacing outdated actions
Browse files Browse the repository at this point in the history
or deprecated practices
  • Loading branch information
andros21 committed Jun 8, 2023
1 parent 87568a4 commit 797f85b
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 56 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/audit-on-push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
security_audit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: actions-rs/audit-check@v1
- uses: actions/checkout@v3
- uses: rustsec/audit-check@v1.4.1
with:
token: ${{ secrets.GITHUB_TOKEN }}
token: ${{ secrets.GITHUB_TOKEN }}
20 changes: 10 additions & 10 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,15 @@ jobs:
-
id: set-matrix
run: |
echo -n '::set-output name=matrix::[' \
(echo -n 'matrix=[' \
&& curl --silent https://raw.githubusercontent.com/docker-library/official-images/master/library/rust \
| grep -E Tags: \
| cut -d ' ' -f 2- \
| sed 's/, /\n/g' \
| sed 's/\(.*\)/"\1",/g' \
| tr '\n' ' ' \
| sed '$ s/..$//' \
&& echo ']'
&& echo ']') >> "$GITHUB_OUTPUT"
build_and_push:
name: Build and push
needs: [rust_image_tag_matrix]
Expand All @@ -41,16 +41,16 @@ jobs:
steps:
-
name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v3
-
name: Set up QEMU
uses: docker/setup-qemu-action@v1
uses: docker/setup-qemu-action@v2
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
uses: docker/setup-buildx-action@v2
-
name: Login to DockerHub
uses: docker/login-action@v1
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
Expand All @@ -61,14 +61,14 @@ jobs:
run: |-
git fetch --tags
VER=$(git tag --sort="-v:refname" | head -n 1 | cut -d"v" -f2)
echo ::set-output name=result::$VER
echo "result=$VER" >> "$GITHUB_OUTPUT"
-
# Check if version matches ^\d+\.\d+\.\d+$
name: Determine if release version
id: is_release_version
run: |
if [[ ${{ steps.package_version.outputs.result }} =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
echo ::set-output name=result::true
echo "result=true" >> "$GITHUB_OUTPUT"
fi
-
name: Determine if duplicated
Expand All @@ -79,9 +79,9 @@ jobs:
if DOCKER_CLI_EXPERIMENTAL=enabled docker manifest inspect $CHEF_IMAGE >/dev/null; then
echo "There is already a pushed image with ${CHEF_IMAGE_TAG} as tag. Skipping."
echo ::set-output name=result::true
echo "result=true" >> "$GITHUB_OUTPUT"
else
echo ::set-output name=result::false
echo "result=false" >> "$GITHUB_OUTPUT"
fi
-
name: Build and push without `latest` tag
Expand Down
51 changes: 13 additions & 38 deletions .github/workflows/general.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,69 +2,44 @@ name: Rust

on: [push, pull_request]

env:
CARGO_TERM_COLOR: always

jobs:
test:
name: Test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
- uses: actions-rs/cargo@v1
with:
command: test
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@stable
- run: cargo test

fmt:
name: Rustfmt
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
- run: rustup component add rustfmt
- uses: actions-rs/cargo@v1
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@stable
with:
command: fmt
args: --all -- --check
components: rustfmt
- run: cargo fmt --all -- --check

clippy:
name: Clippy
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@stable
- run: rustup component add clippy
- uses: actions-rs/cargo@v1
with:
command: clippy
args: -- -D warnings
- run: cargo clippy -- -D warnings

coverage:
name: Code coverage
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
uses: actions/checkout@v3

- name: Install stable toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true
uses: dtolnay/rust-toolchain@stable
- name: Run cargo-tarpaulin
uses: actions-rs/[email protected]
with:
args: '--ignore-tests'
args: '--ignore-tests'
4 changes: 2 additions & 2 deletions .github/workflows/publish_binaries.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
create-release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- uses: taiki-e/create-gh-release-action@v1
with:
branch: main
Expand All @@ -32,7 +32,7 @@ jobs:
os: windows-latest
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- uses: taiki-e/upload-rust-binary-action@v1
with:
bin: cargo-chef
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/scheduled-audit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ jobs:
audit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: actions-rs/audit-check@v1
- uses: actions/checkout@v3
- uses: rustsec/audit-check@v1.4.1
with:
token: ${{ secrets.GITHUB_TOKEN }}
token: ${{ secrets.GITHUB_TOKEN }}

0 comments on commit 797f85b

Please sign in to comment.