diff --git a/.github/actions/Cache Python dependencies/action.yml b/.github/actions/Cache Python dependencies/action.yml new file mode 100644 index 00000000..790e78ac --- /dev/null +++ b/.github/actions/Cache Python dependencies/action.yml @@ -0,0 +1,32 @@ +name: Python CI + +on: [push, pull_request] + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - name: Check out the repository + uses: actions/checkout@v3 + + - name: Set up Python + uses: actions/setup-python@v4 + with: + python-version: '3.9' + + - name: Cache dependencies + uses: actions/cache@v3 + with: + path: ~/.cache/pypoetry # or change based on the tool you use + key: ${{ runner.os }}-python-${{ hashFiles('**/pyproject.toml') }} + restore-keys: | + ${{ runner.os }}-python- + + - name: Install dependencies + run: | + pip install hatch + hatch env create # creates the virtual environment and installs dependencies + + - name: Run tests + run: hatch run test