Skip to content

Commit

Permalink
Add Github workflow for running linter (#25)
Browse files Browse the repository at this point in the history
  • Loading branch information
kdh0102 authored Nov 25, 2024
1 parent 0614a75 commit 76d101e
Showing 1 changed file with 35 additions and 0 deletions.
35 changes: 35 additions & 0 deletions .github/workflows/lint.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Build

on:
push:
branches:
- main
pull_request:
- '**'

# Only the latest workflow run is allowed to run for each PR / branch
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

jobs:
build:
runs-on: ubuntu-24.04
steps:
- name: Checkout 🛎️
uses: actions/checkout@v4
# Cache python dependencies using "requirements.txt" as the cache key
- name: Cache Dependencies 📂
uses: actions/cache@v3
with:
path: ./.venv/
key: ${{ runner.os }}-venv-${{ hashFiles('**/requirements.txt') }}
restore-keys: |
${{ runner.os }}-venv-
# Install python dependencies only if cache was not hit
# `--system-site-packages` argument is used to allow access to system site packages (e.g., bcc)
- name: Install Dependencies 📦
run: python -m venv --system-site-packages ./.venv && . ./.venv/bin/activate && pip install -r requirements.txt
if: steps.cache-venv.outputs.cache-hit != 'true'
- name: Run Ruff Linter 🚨
run: . ./.venv/bin/activate && make lint

0 comments on commit 76d101e

Please sign in to comment.