From 031e079dbb9563cc2bef17c539592356c6952bb5 Mon Sep 17 00:00:00 2001 From: Bowen Gong <67953712+BowenGong2000@users.noreply.github.com> Date: Thu, 8 Feb 2024 22:09:50 -0500 Subject: [PATCH] Create github-actions.yml --- .github/workflow/github-actions.yml | 49 +++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 .github/workflow/github-actions.yml diff --git a/.github/workflow/github-actions.yml b/.github/workflow/github-actions.yml new file mode 100644 index 0000000..545af19 --- /dev/null +++ b/.github/workflow/github-actions.yml @@ -0,0 +1,49 @@ +name: CI + +on: [push] + +jobs: + build-and-test: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + name: Check out repository code + + - name: Set up Python + uses: actions/setup-python@v2 + with: + python-version: '3.x' + + - name: Install PDM + run: | + curl -sSL https://raw.githubusercontent.com/pdm-project/pdm/main/install-pdm.py | python3 - + echo 'export PATH="$HOME/.local/bin:$PATH"' >> $GITHUB_ENV + + - name: Cache PDM dependencies + uses: actions/cache@v2 + with: + path: ~/.pdm + key: ${{ runner.os }}-pdm-${{ hashFiles('**/pdm.lock') }} + restore-keys: | + ${{ runner.os }}-pdm- + + - name: Install Dependencies + run: | + pdm install + + - name: Check Code Formatting with Black + run: | + pdm run black --check src/ tests/ + + - name: Static Analysis with Mypy + run: | + pdm run mypy src/ + + - name: Linting with Ruff + run: | + pdm run ruff src/ tests/ + + - name: Run Unit Tests with Pytest + run: | + pdm run pytest