Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Run clippy on github #157

Closed
wants to merge 10 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 52 additions & 0 deletions .github/workflows/clippy_rustfmt.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: Clippy and rustfmt
on:
pull_request:
push:
branches:
- main
- staging
- trying
workflow_dispatch:
inputs:
container-image:
description: 'Container image to pull from DockerHub'
required: false

jobs:
clippy:
name: Clippy/rustfmt Test
runs-on: ubuntu-20.04
container:
# Duplicated from ci.yml
image: ${{ inputs.container-image || 'timescaledev/toolkit-builder-test:debian-11-amd64' }}
env:
# TODO: See TODOs on duplicate block in ci.yml
CARGO_INCREMENTAL: 0
CARGO_NET_RETRY: 10
CI: 1
RUST_BACKTRACE: short

steps:
- name: Checkout Repository
uses: actions/checkout@v3
with:
ref: ${{ github.event.pull_request.head.sha }}

- name: chown Repository
run: chown -R postgres .

- name: Cache cargo target dir
uses: actions/cache@v3
with:
path: target
key: ${{ runner.os }}-clippy-target-${{ hashFiles('Cargo.lock', '.github/workflows/clippy_rustfmt.yml') }}
restore-keys: ${{ runner.os }}-clippy-target-

- name: Run Clippy
# Github captures stdout and stderr separately and then intermingles them
# in the wrong order. We don't actually care to distinguish, so redirect
# stderr to stdout so we get the proper order.
run: su postgres -c 'sh tools/build clippy 2>&1'

- name: Verify formatting
run: su postgres -c 'cargo fmt --check 2>&1'
26 changes: 0 additions & 26 deletions .github/workflows/code_checks.yml

This file was deleted.

Loading