Update #311
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
name: Checking | |
on: push | |
jobs: | |
setup-requirements: | |
name: Get Requirements | |
runs-on: ubuntu-latest | |
timeout-minutes: 10 | |
steps: | |
# Setup Python (faster than using Python container) | |
- name: Setup Python | |
uses: actions/[email protected] | |
with: | |
python-version: "3.12.0" | |
- name: Check out repository code | |
uses: actions/[email protected] | |
- name: Install Hatch | |
run: python -m pip install --upgrade hatch | |
- 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 | |
~/.local/share/hatch | |
key: ${{ runner.os }}-hatch-${{ env.HATCH_DEP_HASH }} | |
- 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 | |
pylint: | |
name: PyLint | |
runs-on: ubuntu-latest | |
needs: setup-requirements | |
timeout-minutes: 10 | |
steps: | |
- name: Check out repository code | |
uses: actions/[email protected] | |
# Setup Python (faster than using Python container) | |
- name: Setup Python | |
uses: actions/[email protected] | |
with: | |
python-version: "3.12.0" | |
- name: Install Hatch | |
if: steps.cache-hatch.outputs.cache-hit != 'true' | |
run: python -m pip install --upgrade hatch | |
- name: Cache Hatch environment | |
uses: actions/[email protected] | |
with: | |
path: | | |
~/.cache/hatch | |
~/.local/share/hatch | |
key: ${{ runner.os }}-hatch-${{ env.HATCH_DEP_HASH }} | |
- name: Pylint on esbmc_ai | |
run: hatch run pylint esbmc_ai | |
test: | |
name: PyTest | |
needs: setup-requirements | |
runs-on: ubuntu-latest | |
timeout-minutes: 10 | |
steps: | |
- name: Check out repository code | |
uses: actions/[email protected] | |
# Setup Python (faster than using Python container) | |
- name: Setup Python | |
uses: actions/[email protected] | |
with: | |
python-version: "3.12.0" | |
- name: Install Hatch | |
if: steps.cache-hatch.outputs.cache-hit != 'true' | |
run: python -m pip install --upgrade hatch | |
- name: Cache Hatch environment | |
uses: actions/[email protected] | |
with: | |
path: | | |
~/.cache/hatch | |
~/.local/share/hatch | |
key: ${{ runner.os }}-hatch-${{ env.HATCH_DEP_HASH }} | |
- name: Run test suite | |
run: hatch run pytest | |
incremenet_version: | |
name: Increment Version | |
runs-on: ubuntu-latest | |
needs: setup-requirements | |
timeout-minutes: 10 | |
# Configure permissions for git push | |
permissions: | |
contents: write | |
steps: | |
- name: Check out repository code | |
uses: actions/[email protected] | |
with: | |
persist-credentials: false # otherwise, the token used is the GITHUB_TOKEN, instead of your personal access token. | |
fetch-depth: 0 # otherwise, there would be errors pushing refs to the destination repository. | |
# Setup Python (faster than using Python container) | |
- name: Setup Python | |
uses: actions/[email protected] | |
with: | |
python-version: "3.12.0" | |
- name: Install Hatch | |
if: steps.cache-hatch.outputs.cache-hit != 'true' | |
run: python -m pip install --upgrade hatch | |
- name: Cache Hatch environment | |
uses: actions/[email protected] | |
with: | |
path: | | |
~/.cache/hatch | |
~/.local/share/hatch | |
key: ${{ runner.os }}-hatch-${{ env.HATCH_DEP_HASH }} | |
- name: Invrement Version | |
run: hatch version dev | |
- name: Configure Git | |
run: | | |
git config --global user.email "github-actions[bot]@users.noreply.github.com" | |
git config --global user.name "github-actions[bot]" | |
git config pull.ff only | |
# Add and commit without changing message | |
- name: Git Add | |
run: | | |
git add esbmc_ai/__about__.py | |
git commit --amend --no-edit | |
git pull | |
- name: GitHub Push | |
if: github.ref != 'refs/heads/master' | |
uses: ad-m/[email protected] | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
branch: ${{ github.ref }} | |
build: | |
name: Build | |
runs-on: ubuntu-latest | |
needs: incremenet_version | |
timeout-minutes: 10 | |
steps: | |
- name: Check out repository code | |
uses: actions/[email protected] | |
# Setup Python (faster than using Python container) | |
- name: Setup Python | |
uses: actions/[email protected] | |
with: | |
python-version: "3.12.0" | |
- name: Install Hatch | |
if: steps.cache-hatch.outputs.cache-hit != 'true' | |
run: python -m pip install --upgrade hatch | |
- name: Cache Hatch environment | |
uses: actions/[email protected] | |
with: | |
path: | | |
~/.cache/hatch | |
~/.local/share/hatch | |
key: ${{ runner.os }}-hatch-${{ env.HATCH_DEP_HASH }} | |
- name: Hatch build | |
run: hatch build | |
- name: Upload build files | |
uses: actions/[email protected] | |
with: | |
name: build | |
path: dist |