-
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
416a7aa
commit 9c8bf5d
Showing
1 changed file
with
37 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,25 +17,36 @@ jobs: | |
- name: Check out repository code | ||
uses: actions/[email protected] | ||
|
||
- name: Get Hatch Dependency Hash | ||
run: echo "HATCH_DEP_HASH=$(hatch dep hash)" >> $GITHUB_ENV | ||
|
||
- name: Cache Hatch environment | ||
uses: actions/[email protected] | ||
with: | ||
path: ~/.cache/hatch | ||
key: ${{ runner.os }}-hatch-${{ env.HATCH_DEP_HASH }} | ||
|
||
- name: Install Hatch | ||
if: steps.cache-hatch.outputs.cache-hit != 'true' | ||
run: python -m pip install --upgrade hatch | ||
|
||
- name: Generate Requirements | ||
run: python -m hatch dep show requirements > requirements.txt | ||
|
||
# Upload requirements to have them | ||
- name: Upload Requirements | ||
uses: actions/[email protected] | ||
with: | ||
name: requirements | ||
path: requirements.txt | ||
|
||
setup-pipenv: | ||
name: Setup Environment | ||
needs: setup-requirements | ||
build: | ||
name: Build | ||
runs-on: ubuntu-latest | ||
needs: setup-requirements | ||
timeout-minutes: 10 | ||
|
||
steps: | ||
seteps: | ||
- name: Check out repository code | ||
uses: actions/[email protected] | ||
|
||
|
@@ -44,33 +55,26 @@ jobs: | |
uses: actions/[email protected] | ||
with: | ||
python-version: "3.12.0" | ||
|
||
- name: Download Requirements | ||
uses: actions/[email protected] | ||
with: | ||
name: requirements | ||
path: . | ||
|
||
- name: Install Pipenv | ||
run: python -m pip install --upgrade pipenv wheel | ||
|
||
- name: Cache Pipenv | ||
id: cache-pipenv | ||
- name: Cache Hatch environment | ||
uses: actions/[email protected] | ||
with: | ||
path: ~/.local/share/virtualenvs | ||
key: ${{ runner.os }}-pipenv-${{ hashFiles('**/Pipfile.lock') }} | ||
path: ~/.cache/hatch | ||
key: ${{ runner.os }}-hatch-${{ env.HATCH_DEP_HASH }} | ||
|
||
- name: Install dependencies | ||
if: steps.cache-pipenv.outputs.cache-hit != 'true' | ||
run: | | ||
pipenv install -r requirements.txt | ||
pipenv lock | ||
- name: Hatch build | ||
run: hatch build | ||
|
||
- name: Upload build files | ||
uses: actions/[email protected] | ||
with: | ||
name: build | ||
path: dist | ||
|
||
pylint: | ||
name: PyLint | ||
runs-on: ubuntu-latest | ||
needs: setup-pipenv | ||
needs: setup-requirements | ||
timeout-minutes: 10 | ||
|
||
steps: | ||
|
@@ -83,20 +87,18 @@ jobs: | |
with: | ||
python-version: "3.12.0" | ||
|
||
- name: Cache Pipenv | ||
id: cache-pipenv | ||
- name: Cache Hatch environment | ||
uses: actions/[email protected] | ||
with: | ||
path: ~/.local/share/virtualenvs | ||
key: ${{ runner.os }}-pipenv-${{ hashFiles('**/Pipfile.lock') }} | ||
path: ~/.cache/hatch | ||
key: ${{ runner.os }}-hatch-${{ env.HATCH_DEP_HASH }} | ||
|
||
- name: Pylint on esbmc_ai | ||
run: | | ||
pipenv run pylint esbmc_ai | ||
run: hatch run pylint esbmc_ai | ||
|
||
test: | ||
name: PyTest | ||
needs: setup-pipenv | ||
needs: setup-requirements | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 10 | ||
|
||
|
@@ -110,12 +112,12 @@ jobs: | |
with: | ||
python-version: "3.12.0" | ||
|
||
- name: Cache Pipenv | ||
id: cache-pipenv | ||
- name: Cache Hatch environment | ||
uses: actions/[email protected] | ||
with: | ||
path: ~/.local/share/virtualenvs | ||
key: ${{ runner.os }}-pipenv-${{ hashFiles('**/Pipfile.lock') }} | ||
path: ~/.cache/hatch | ||
key: ${{ runner.os }}-hatch-${{ env.HATCH_DEP_HASH }} | ||
|
||
- name: Run test suite | ||
run: pipenv run pytest -v | ||
run: hatch run pytest | ||
|