From 600fd28d69a58369bbea75e2be869108eedb2a4a Mon Sep 17 00:00:00 2001 From: Faisal Fawad Date: Sun, 21 Jul 2024 18:17:52 -0400 Subject: [PATCH] POC --- .github/workflows/build.yml | 35 ---------------- .github/workflows/code-quality.yml | 38 ------------------ .github/workflows/pipeline.yml | 64 ++++++++++++++++++++++++++++++ 3 files changed, 64 insertions(+), 73 deletions(-) delete mode 100644 .github/workflows/build.yml delete mode 100644 .github/workflows/code-quality.yml create mode 100644 .github/workflows/pipeline.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml deleted file mode 100644 index f8dc5b2..0000000 --- a/.github/workflows/build.yml +++ /dev/null @@ -1,35 +0,0 @@ -name: Build -on: - workflow_call: # Reusable workflow -jobs: - build: - runs-on: windows-latest - steps: - - uses: actions/checkout@v4 - - uses: actions/setup-python@v5 - with: - python-version: "3.12" - cache: "pip" - - name: Display Python version - run: python -c "import sys; print(sys.version)" - - name: Restore cached .venv - uses: actions/cache/restore@v4 - with: - key: venv - path: .venv - - name: Install dependencies - run: | - python -m pip install --upgrade pip - pip install poetry - poetry config --list - make install - - name: Cache .venv - uses: actions/cache/save@v4 - with: - key: venv - path: .venv - - name: Upload .venv - uses: actions/upload-artifact@v3 - with: - name: venv - path: .venv \ No newline at end of file diff --git a/.github/workflows/code-quality.yml b/.github/workflows/code-quality.yml deleted file mode 100644 index 5a7a241..0000000 --- a/.github/workflows/code-quality.yml +++ /dev/null @@ -1,38 +0,0 @@ -name: Code Quality -on: [pull_request] -jobs: - build: - uses: ./.github/workflows/build.yml - test: - name: Test - needs: [build] - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - uses: actions/setup-python@v5 - with: - python-version: "3.12" - cache: "pip" - - name: Download .venv - uses: actions/download-artifact@v3 - with: - name: venv - - name: Run tests - run: make test - lint: - name: Lint - needs: [build] - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - uses: actions/setup-python@v5 - with: - python-version: "3.12" - cache: "pip" - - name: Download .venv - uses: actions/download-artifact@v3 - with: - name: venv - - name: Run linter - run: make lint - diff --git a/.github/workflows/pipeline.yml b/.github/workflows/pipeline.yml new file mode 100644 index 0000000..0717501 --- /dev/null +++ b/.github/workflows/pipeline.yml @@ -0,0 +1,64 @@ +name: PR Pipeline +on: [pull_request] +jobs: + build: + name: Build + runs-on: windows-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-python@v5 + with: + python-version: "3.12" + cache: "pip" + - name: Display Python version + run: python -c "import sys; print(sys.version)" + - name: Restore cached .venv + uses: actions/cache/restore@v4 + with: + key: venv-${{ runner.os }}-${{ hashFiles('pyproject.toml') }} + path: .venv + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install poetry + poetry config --list + make install + - name: Cache .venv + uses: actions/cache/save@v4 + with: + key: venv-${{ runner.os }}-${{ hashFiles('pyproject.toml') }} + path: .venv + test: + name: Test + needs: [build] + runs-on: windows-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-python@v5 + with: + python-version: "3.12" + cache: "pip" + - name: Restore cached .venv + uses: actions/cache/restore@v4 + with: + key: venv-${{ runner.os }}-${{ hashFiles('pyproject.toml') }} + path: .venv + - name: Run tests + run: make test + lint: + name: Lint + needs: [build] + runs-on: windows-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-python@v5 + with: + python-version: "3.12" + cache: "pip" + - name: Restore cached .venv + uses: actions/cache/restore@v4 + with: + key: venv-${{ runner.os }}-${{ hashFiles('pyproject.toml') }} + path: .venv + - name: Run linter + run: make lint