Skip to content

Commit

Permalink
revert the basic CI
Browse files Browse the repository at this point in the history
  • Loading branch information
Szegoo committed Apr 16, 2024
1 parent f5358cf commit 4f17264
Showing 1 changed file with 39 additions and 37 deletions.
76 changes: 39 additions & 37 deletions .github/workflows/basic.yml
Original file line number Diff line number Diff line change
@@ -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/[email protected]
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/[email protected]
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

0 comments on commit 4f17264

Please sign in to comment.