Skip to content

Commit

Permalink
ci: replace the rust-relevant ci process with the go one
Browse files Browse the repository at this point in the history
Signed-off-by: Phoeniix Zhao <[email protected]>
  • Loading branch information
Phoenix500526 committed Dec 8, 2023
1 parent f81258a commit f2d3142
Show file tree
Hide file tree
Showing 8 changed files with 35 additions and 401 deletions.
8 changes: 0 additions & 8 deletions .github/scripts/install_deps.sh

This file was deleted.

111 changes: 30 additions & 81 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,98 +4,46 @@ on:
schedule:
- cron: "00 19 * * *" # run ci periodically at 3 am
pull_request:
branches: [ main ]
branches: [main]

env:
CI_RUST_TOOLCHAIN: 1.70.0
GO_VERSION: '1.21'

jobs:
outdated:
name: Outdated
format:
name: Format
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions-rs/[email protected]
with:
crate: cargo-outdated
version: latest
- run: cargo outdated --workspace
- name: Checkout code
uses: actions/checkout@v3

audit:
name: Audit
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
crate: cargo-audit
use-tool-cache: true
- uses: actions-rs/[email protected]
with:
token: ${{ secrets.GITHUB_TOKEN }}
- name: Setup Go
uses: actions/setup-go@v4
with:
go-version: ${{env.GO_VERSION}}

check:
runs-on: ubuntu-latest
name: Check
steps:
- uses: actions/checkout@v2
- run: sudo bash ./.github/scripts/install_deps.sh
- uses: actions-rs/toolchain@v1
with:
profile: default
toolchain: ${{ env.CI_RUST_TOOLCHAIN }}
override: true
- uses: Swatinem/rust-cache@v2
- uses: actions-rs/cargo@v1
with:
command: check
- name: Format code
uses: iamnotaturtle/[email protected]
with:
# This part is also where you can pass other options, for example:
only_changed: True

fmt:
name: Format
lint:
name: Lint Check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
profile: default
toolchain: ${{ env.CI_RUST_TOOLCHAIN }}
override: true
- uses: actions-rs/cargo@v1
with:
command: fmt
args: --all -- --check
- name: Checkout code
uses: actions/checkout@v3

test:
runs-on: ubuntu-latest
name: Test
steps:
- uses: actions/checkout@v2
- run: sudo bash ./.github/scripts/install_deps.sh
- uses: actions-rs/toolchain@v1
- name: Setup Go
uses: actions/setup-go@v4
with:
profile: default
toolchain: ${{ env.CI_RUST_TOOLCHAIN }}
override: true
- uses: Swatinem/rust-cache@v2
- uses: actions-rs/cargo@v1
with:
command: test
go-version: ${{env.GO_VERSION}}

clippy:
runs-on: ubuntu-latest
name: Clippy
steps:
- uses: actions/checkout@v2
- run: sudo bash ./.github/scripts/install_deps.sh
- uses: actions-rs/toolchain@v1
- name: golangci-lint
uses: golangci/golangci-lint-action@v3
with:
profile: default
toolchain: ${{ env.CI_RUST_TOOLCHAIN }}
override: true
- uses: Swatinem/rust-cache@v2
- uses: actions-rs/cargo@v1
with:
command: clippy
args: --all-targets --all-features -- -D warnings
version: v1.54.2

commit:
name: Commit Message Validation
Expand All @@ -118,7 +66,8 @@ jobs:
name: Spell Check
runs-on: ubuntu-latest
steps:
- name: Checkout Actions Repository
uses: actions/checkout@v2
- name: Check Spelling
uses: crate-ci/typos@master
- name: Checkout Actions Repository
uses: actions/checkout@v2

- name: Check Spelling
uses: crate-ci/typos@master
33 changes: 0 additions & 33 deletions .github/workflows/coverage.yml

This file was deleted.

126 changes: 0 additions & 126 deletions .github/workflows/docker.yml

This file was deleted.

56 changes: 0 additions & 56 deletions .github/workflows/e2e.yml

This file was deleted.

Loading

0 comments on commit f2d3142

Please sign in to comment.