Skip to content

Commit

Permalink
Update workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
Yiannis128 committed Nov 7, 2024
1 parent f8caa26 commit 416a7aa
Showing 1 changed file with 45 additions and 19 deletions.
64 changes: 45 additions & 19 deletions .github/workflows/workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,48 @@ jobs:
name: requirements
path: requirements.txt

setup-pipenv:
name: Setup Environment
needs: setup-requirements
runs-on: ubuntu-latest
timeout-minutes: 10

steps:
- name: Check out repository code
uses: actions/checkout@v4.2.2

# Setup Python (faster than using Python container)
- name: Setup Python
uses: actions/setup-python@v5.3.0
with:
python-version: "3.12.0"

- name: Download Requirements
uses: actions/download-artifact@v4.1.8
with:
name: requirements
path: .

- name: Install Pipenv
run: python -m pip install --upgrade pipenv wheel

- name: Cache Pipenv
id: cache-pipenv
uses: actions/cache@v4.1.2
with:
path: ~/.local/share/virtualenvs
key: ${{ runner.os }}-pipenv-${{ hashFiles('**/Pipfile.lock') }}

- name: Install dependencies
if: steps.cache-pipenv.outputs.cache-hit != 'true'
run: |
pipenv install -r requirements.txt
pipenv lock
pylint:
name: PyLint
runs-on: ubuntu-latest
needs: setup-pipenv
timeout-minutes: 10

steps:
Expand All @@ -45,17 +83,20 @@ jobs:
with:
python-version: "3.12.0"

- name: Install pipenv
run: |
python -m pip install --upgrade pipenv wheel
- name: Cache Pipenv
id: cache-pipenv
uses: actions/cache@v4.1.2
with:
path: ~/.local/share/virtualenvs
key: ${{ runner.os }}-pipenv-${{ hashFiles('**/Pipfile.lock') }}

- name: Pylint on esbmc_ai
run: |
pipenv run pylint esbmc_ai
test:
name: PyTest
needs: setup-requirements
needs: setup-pipenv
runs-on: ubuntu-latest
timeout-minutes: 10

Expand All @@ -69,27 +110,12 @@ jobs:
with:
python-version: "3.12.0"

- name: Download Requirements
uses: actions/download-artifact@v4.1.8
with:
name: requirements
path: .

- name: Install Environment
run: python -m pip install --upgrade pipenv wheel

- name: Cache Pipenv
id: cache-pipenv
uses: actions/cache@v4.1.2
with:
path: ~/.local/share/virtualenvs
key: ${{ runner.os }}-pipenv-${{ hashFiles('**/Pipfile.lock') }}

- name: Install dependencies
if: steps.cache-pipenv.outputs.cache-hit != 'true'
run: |
pipenv install -r requirements.txt
pipenv lock
- name: Run test suite
run: pipenv run pytest -v

0 comments on commit 416a7aa

Please sign in to comment.