Skip to content

Commit

Permalink
Merge pull request #7 from au-imclab/zeyus-patch-1
Browse files Browse the repository at this point in the history
hatch cache
  • Loading branch information
zeyus authored Nov 28, 2023
2 parents e833333 + 40993af commit f0cfd22
Show file tree
Hide file tree
Showing 4 changed files with 53 additions and 18 deletions.
22 changes: 17 additions & 5 deletions .github/workflows/lint-test-pr-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Test, Build, Publish

on:
pull_request:
types: [opened, reopened]
types: [opened, reopened, synchronize]
branches:
- main
- dev
Expand All @@ -12,6 +12,7 @@ on:
jobs:
build:
runs-on: ubuntu-latest
environment: ci
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
Expand All @@ -21,17 +22,28 @@ jobs:
3.10
3.11
- name: Set up pip cache
if: runner.os == 'Linux'
uses: actions/cache@v3
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('pyproject.toml') }}
restore-keys: ${{ runner.os }}-pip-
- name: Set up hatch cache
uses: actions/cache@v3
with:
path: ~/.hatchcache
key: ${{ runner.os }}-hatchcache-${{ hashFiles('pyproject.toml') }}
restore-keys: ${{ runner.os }}-hatchcache-
- name: Set up hatch cache (data)
uses: actions/cache@v3
with:
path: ~/.hatchdata
key: ${{ runner.os }}-hatchdata-${{ hashFiles('pyproject.toml') }}
restore-keys: ${{ runner.os }}-hatchdata-
- name: Install Hatch
run: pipx install hatch
- name: Run tests
run: hatch run test
run: hatch --cache-dir ~/.hatchcache --data-dir ~/.hatchdata run test
- name: Lint and Type check
run: hatch -e lint run all
run: hatch --cache-dir ~/.hatchcache --data-dir ~/.hatchdata -e lint run all
- name: Build dist
run: hatch build
run: hatch --cache-dir ~/.hatchcache --data-dir ~/.hatchdata build
22 changes: 17 additions & 5 deletions .github/workflows/pre-release.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Create pre-release on Main (GH Only)
name: Create pre-release on Github

on:
push:
Expand All @@ -8,6 +8,7 @@ on:
jobs:
build:
runs-on: ubuntu-latest
environment: release
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
Expand All @@ -17,20 +18,31 @@ jobs:
3.10
3.11
- name: Set up pip cache
if: runner.os == 'Linux'
uses: actions/cache@v3
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('pyproject.toml') }}
restore-keys: ${{ runner.os }}-pip-
- name: Set up hatch cache
uses: actions/cache@v3
with:
path: ~/.hatchcache
key: ${{ runner.os }}-hatchcache-${{ hashFiles('pyproject.toml') }}
restore-keys: ${{ runner.os }}-hatchcache-
- name: Set up hatch cache (data)
uses: actions/cache@v3
with:
path: ~/.hatchdata
key: ${{ runner.os }}-hatchdata-${{ hashFiles('pyproject.toml') }}
restore-keys: ${{ runner.os }}-hatchdata-
- name: Install Hatch
run: pipx install hatch
- name: Run tests
run: hatch run test
run: hatch --cache-dir ~/.hatchcache --data-dir ~/.hatchdata run test
- name: Lint and Type check
run: hatch -e lint run all
run: hatch --cache-dir ~/.hatchcache --data-dir ~/.hatchdata -e lint run all
- name: Build dist
run: hatch build
run: hatch --cache-dir ~/.hatchcache --data-dir ~/.hatchdata build
- uses: ncipollo/release-action@v1
with:
tag: "development-${{ github.sha }}"
Expand Down
25 changes: 18 additions & 7 deletions .github/workflows/test-build-publish.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Test, Build, Publish
name: Test, Build, Release, Publish (Pypi)

on:
push:
Expand All @@ -7,6 +7,7 @@ on:
jobs:
build:
runs-on: ubuntu-latest
environment: release
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
Expand All @@ -16,23 +17,33 @@ jobs:
3.10
3.11
- name: Set up pip cache
if: runner.os == 'Linux'
uses: actions/cache@v3
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('pyproject.toml') }}
restore-keys: ${{ runner.os }}-pip-
- name: Set up hatch cache
uses: actions/cache@v3
with:
path: ~/.hatchcache
key: ${{ runner.os }}-hatchcache-${{ hashFiles('pyproject.toml') }}
restore-keys: ${{ runner.os }}-hatchcache-
- name: Set up hatch cache (data)
uses: actions/cache@v3
with:
path: ~/.hatchdata
key: ${{ runner.os }}-hatchdata-${{ hashFiles('pyproject.toml') }}
restore-keys: ${{ runner.os }}-hatchdata-
- name: Install Hatch
run: pipx install hatch
- name: Run tests
run: hatch run test
run: hatch --cache-dir ~/.hatchcache --data-dir ~/.hatchdata run test
- name: Lint and Type check
run: hatch -e lint run all
run: hatch --cache-dir ~/.hatchcache --data-dir ~/.hatchdata -e lint run all
- name: Build dist
run: hatch build
run: hatch --cache-dir ~/.hatchcache --data-dir ~/.hatchdata build
- name: Publish on PyPI
if: github.ref == 'refs/heads/main'
run: hatch publish
run: hatch --cache-dir ~/.hatchcache --data-dir ~/.hatchdata publish
- uses: ncipollo/release-action@v1
with:
artifacts: "dist/*"
2 changes: 1 addition & 1 deletion src/mopipe/__about__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# SPDX-FileCopyrightText: 2023-present zeyus <[email protected]>
#
# SPDX-License-Identifier: MIT
__version__ = "0.0.2"
__version__ = "0.0.3"

0 comments on commit f0cfd22

Please sign in to comment.