From 01754e9c1f293a1f3b849f2aedf7665a53725e0a Mon Sep 17 00:00:00 2001 From: Madison Swain-Bowden Date: Sun, 9 Apr 2023 16:55:58 -0700 Subject: [PATCH] Add build step to PR CI/CD (#105) * Add build step to PR CI/CD * Use pre-commit action * Add an env step --- .github/workflows/pull-request.yml | 14 +++++++++++--- justfile | 6 +++++- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/.github/workflows/pull-request.yml b/.github/workflows/pull-request.yml index 40aa9f2..b67c750 100644 --- a/.github/workflows/pull-request.yml +++ b/.github/workflows/pull-request.yml @@ -12,10 +12,8 @@ jobs: - uses: actions/setup-python@v4 with: python-version: 3.11 - - name: Install Dependencies - run: pip install pre-commit - name: Run static checks - run: pre-commit run --all-files + uses: pre-commit/action@v3.0.0 test: runs-on: ubuntu-latest @@ -31,3 +29,13 @@ jobs: run: pip install pytest pytest-cov - name: Test with pytest run: pytest --cov . + + build: + runs-on: ubuntu-latest + needs: + - static-checks + steps: + - uses: actions/checkout@v3 + - uses: extractions/setup-just@v1 + - name: Build image + run: just build diff --git a/justfile b/justfile index f1c433d..fa72391 100644 --- a/justfile +++ b/justfile @@ -14,8 +14,12 @@ set positional-arguments default: @just --list --unsorted +# Create a .env file if it doesn't exist +env: + @([ ! -f .env ] && touch .env) || true + # Build the containers -build: +build: env {{ DC }} build # Spin up all (or one) service