From a2cc29f1c0c36eebe13344d6a228aeeb28f87684 Mon Sep 17 00:00:00 2001 From: Praveen Gupta Date: Thu, 14 Nov 2024 00:39:53 -0800 Subject: [PATCH] Adds github workflow --- .github/workflows/lint-and-test.yaml | 38 ++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 .github/workflows/lint-and-test.yaml diff --git a/.github/workflows/lint-and-test.yaml b/.github/workflows/lint-and-test.yaml new file mode 100644 index 0000000..34ea269 --- /dev/null +++ b/.github/workflows/lint-and-test.yaml @@ -0,0 +1,38 @@ +name: Python CI + +on: + push: + branches: [ main ] + pull_request: + branches: [ main ] + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + + - name: Set up Python + uses: actions/setup-python@v4 + with: + python-version: '3.x' + + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install -r requirements.txt + pip install black pytest + + - name: Install CodeQL CLI + run: | + wget https://github.com/github/codeql-action/releases/latest/download/codeql-bundle-linux64.tar.gz + tar xzf codeql-bundle-linux64.tar.gz + echo "${{ github.workspace }}/codeql" >> $GITHUB_PATH + + # - name: Check linting with Black + # run: black --check . + - name: Format with Black + run: black . + + - name: Run tests + run: pytest tests/