From 4f17264fdcf82f8a011a5464a5613191d16f7cf6 Mon Sep 17 00:00:00 2001 From: Sergej Date: Tue, 16 Apr 2024 20:57:47 +0200 Subject: [PATCH] revert the basic CI --- .github/workflows/basic.yml | 76 +++++++++++++++++++------------------ 1 file changed, 39 insertions(+), 37 deletions(-) diff --git a/.github/workflows/basic.yml b/.github/workflows/basic.yml index 3f6a2ef9..8ea03c4c 100644 --- a/.github/workflows/basic.yml +++ b/.github/workflows/basic.yml @@ -1,54 +1,56 @@ name: Basic +# Controls when the action will run. on: + # Triggers the workflow on push or pull request events but only for the main branch pull_request: branches: - - main + - main push: branches: - - main + - main + # Allows you to run this workflow manually from the Actions tab workflow_dispatch: +# A workflow run is made up of one or more jobs that can run sequentially or in parallel jobs: - prepare: - runs-on: ubuntu-22.04 - outputs: - cache-key: ${{ steps.cache-key.outputs.key }} - steps: - - uses: actions/checkout@v4 - - name: Generate cache key - id: cache-key - run: echo "::set-output name=key::${{ runner.os }}-$(date +%Y-%m-%d)-$(git rev-parse --short HEAD)" - - uses: Swatinem/rust-cache@v2 - with: - key: ${{ steps.cache-key.outputs.key }} - restore-keys: | - ${{ runner.os }}-${{ github.event.pull_request.head.repo.default_branch }}- - ${{ runner.os }}- - fmt: - needs: prepare runs-on: ubuntu-22.04 + steps: - - uses: actions/checkout@v4 - - name: Setup Rust environment - run: | - source $HOME/.cargo/env - rustup default nightly - - name: Cargo fmt - run: cargo fmt --all -- --check + - uses: actions/checkout@v4 + - uses: Swatinem/rust-cache@v2 + - uses: ./.github/actions/setup + + - name: Setup SSH + uses: webfactory/ssh-agent@v0.5.3 + with: + ssh-private-key: ${{ secrets.GH_TOKEN }} + + - name: Use Git CLI for Cargo + run: echo "CARGO_NET_GIT_FETCH_WITH_CLI=true" >> $GITHUB_ENV + + - name: Cargo fmt + run: cargo +nightly fmt --all -- --check lint-and-check: - needs: prepare runs-on: ubuntu-22.04 + steps: - - uses: actions/checkout@v4 - - name: Setup Rust environment - run: | - source $HOME/.cargo/env - rustup default nightly - echo "CARGO_NET_GIT_FETCH_WITH_CLI=true" >> $GITHUB_ENV - - name: Cargo clippy - run: cargo clippy -- -D warnings - - name: Check Code - run: cargo check + - uses: actions/checkout@v4 + - uses: Swatinem/rust-cache@v2 + - uses: ./.github/actions/setup + + - name: Setup SSH + uses: webfactory/ssh-agent@v0.5.3 + with: + ssh-private-key: ${{ secrets.GH_TOKEN }} + + - name: Use Git CLI for Cargo + run: echo "CARGO_NET_GIT_FETCH_WITH_CLI=true" >> $GITHUB_ENV + + - name: Cargo clippy + run: cargo +nightly clippy -- -D warnings + + - name: Check Code + run: cargo check