From 112cb8dc1e2151e20344799895d9cf2c74ae3bb7 Mon Sep 17 00:00:00 2001 From: phoenix Date: Sun, 14 Jun 2026 18:20:01 -0400 Subject: [PATCH] Updated workflow --- .github/workflows/pr.yml | 65 ++++++++++++++++++++++++++++++++++ .github/workflows/workflow.yml | 3 -- 2 files changed, 65 insertions(+), 3 deletions(-) create mode 100644 .github/workflows/pr.yml diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml new file mode 100644 index 0000000..975bf0b --- /dev/null +++ b/.github/workflows/pr.yml @@ -0,0 +1,65 @@ +name: sender pr + +on: + pull_request: + branches: + - main + +jobs: + check: + name: Check + runs-on: ubuntu-24.04 + steps: + - uses: actions/checkout@v5 + - uses: actions-rust-lang/setup-rust-toolchain@v1 + with: + toolchain: 1.95 + - uses: Swatinem/rust-cache@v2 + - run: | + mkdir -p ~/.ssh + echo "${{ secrets.MYREPO_TOKEN }}" > ~/.ssh/deploy_key + chmod 600 ~/.ssh/deploy_key + ssh-keyscan ${{ secrets.MY_HOST }} >> ~/.ssh/known_hosts + eval $(ssh-agent -s) + ssh-add -v ~/.ssh/deploy_key + cargo check + + fmt: + name: Rustfmt + runs-on: ubuntu-24.04 + needs: setup_ssh + steps: + - uses: actions/checkout@v5 + - uses: actions-rust-lang/setup-rust-toolchain@v1 + with: + toolchain: 1.95 + - uses: Swatinem/rust-cache@v2 + - run: rustup component add rustfmt + - run: | + mkdir -p ~/.ssh + echo "${{ secrets.MYREPO_TOKEN }}" > ~/.ssh/deploy_key + chmod 600 ~/.ssh/deploy_key + ssh-keyscan ${{ secrets.MY_HOST }} >> ~/.ssh/known_hosts + eval $(ssh-agent -s) + ssh-add -v ~/.ssh/deploy_key + cargo fmt --all -- --check + + clippy: + name: Clippy + runs-on: ubuntu-24.04 + needs: setup_ssh + steps: + - uses: actions/checkout@v5 + - uses: actions-rust-lang/setup-rust-toolchain@v1 + with: + toolchain: 1.95 + - uses: Swatinem/rust-cache@v2 + - run: rustup component add clippy + - run: | + mkdir -p ~/.ssh + echo "${{ secrets.MYREPO_TOKEN }}" > ~/.ssh/deploy_key + chmod 600 ~/.ssh/deploy_key + ssh-keyscan ${{ secrets.MY_HOST }} >> ~/.ssh/known_hosts + eval $(ssh-agent -s) + ssh-add -v ~/.ssh/deploy_key + cargo clippy -- -D warnings diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml index 157d9a2..ec3dff9 100644 --- a/.github/workflows/workflow.yml +++ b/.github/workflows/workflow.yml @@ -4,9 +4,6 @@ on: push: branches: - main - pull_request: - branches: - - main jobs: check: