Skip to content

Commit

Permalink
👷🏻 ci: implement tests pipeline
Browse files Browse the repository at this point in the history
Refs: DEVTOOL-22
  • Loading branch information
adriamontoto committed Jul 20, 2024
1 parent a8399c7 commit 349fde1
Show file tree
Hide file tree
Showing 2 changed files with 56 additions and 0 deletions.
52 changes: 52 additions & 0 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: Test Pipeline

on:
push:
branches:
- master
- develop
pull_request:
types:
- opened
- synchronize

jobs:
test:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest]
python-version: [3.11]
timeout-minutes: 15
steps:
- name: 📥 Checkout the repository
uses: actions/checkout@v4
with:
fetch-depth: 0 # Only last commit

- name: 🐍 Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}

- id: cache
name: 📦 Create cache
uses: actions/cache@v4
with:
path: ${{ env.pythonLocation }}
key: ${{ runner.os }}-python-${{ matrix.python-version }}-${{ hashFiles('pyproject.toml', 'requirements.txt', 'requirements_dev.txt') }}

- name: 📦 Install dependencies
if: steps.cache.outputs.cache-hit != 'true'
run: |
pip install -r requirements_dev.txt --no-warn-script-location --no-python-version-warning --no-warn-conflicts
- name: 🏃 Run Tests
run: bash scripts/test.sh

- name: 🫙 Store tests coverage
uses: actions/upload-artifact@v4
if: always()
with:
name: test_coverage_report_${{ runner.os }}_${{ matrix.python-version }}
path: htmlcov
4 changes: 4 additions & 0 deletions scripts/test.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/sh -e
set -x

pytest developing_tools --cov-report html

0 comments on commit 349fde1

Please sign in to comment.