Skip to content

swap logic generalize #2697

swap logic generalize

swap logic generalize #2697

Workflow file for this run

name: Lint Quasar code
on:
pull_request:
branches:
- main
push:
branches:
- main
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref }}
cancel-in-progress: true
# This workflow makes x86_64 binaries for linux.
# TODO: add darwin later
jobs:
lint-go:
runs-on: ubuntu-latest
steps:
- name: Check out repository code
uses: actions/checkout@v3
- name: Get git diff
uses: technote-space/get-diff-action@v6.1.2
with:
PATTERNS: |
**/**.go
go.mod
go.sum
Makefile
- name: Setup Golang
if: env.GIT_DIFF
uses: actions/setup-go@v4
with:
go-version: 1.20.7
- name: Display go version
if: env.GIT_DIFF
run: go version
- name: Go lint
if: env.GIT_DIFF
run: make lint
lint-rust:
runs-on: ubuntu-latest
steps:
- name: Check out repository code
uses: actions/checkout@v3
- name: Get git diff
uses: technote-space/get-diff-action@v6.1.2
with:
PATTERNS: |
**/**.rs
Makefile
- name: Install Rust
if: env.GIT_DIFF
uses: dtolnay/rust-toolchain@stable
- name: Show versions
if: env.GIT_DIFF
run: rustc -V && cargo -V
- name: Rust lint
if: env.GIT_DIFF
run: cd smart-contracts && RUSTFLAGS="-Dwarnings" cargo clippy --workspace -- -D warnings --A deprecated
- name: Rust format check
if: env.GIT_DIFF
run: cd smart-contracts && cargo fmt --all -- --check