Bump actions/cache from 3 to 4 #31
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: Pull Request Check | |
on: [pull_request] | |
jobs: | |
format: | |
# Check if the PR is not from a fork | |
name: Format Code | |
if: github.event.pull_request.head.repo.full_name == github.repository | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
ref: ${{ github.head_ref }} | |
- name: yapf setup | |
run: | | |
python -m pip install --upgrade pip | |
pip install yapf | |
pip install toml | |
- name: Show files | |
run: ls -la | |
- name: yapf run | |
run: yapf --in-place --recursive --verbose . | |
- name: Check for modified files | |
id: git-check | |
run: echo ::set-output name=modified::$(if git diff-index --quiet HEAD --; then echo "false"; else echo "true"; fi) | |
- name: Push changes | |
if: steps.git-check.outputs.modified == 'true' | |
run: | | |
git config --global user.name 'YAPF Checker' | |
git config --global user.email '[email protected]' | |
git remote set-url origin https://x-access-token:${{ secrets.YO_JENKINS_YAPF }}@github.com/${{ github.repository }} | |
git commit -am "YAPF formatting check automated changes" | |
git push | |
install_run: | |
name: Install and Run | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [ubuntu-latest, macos-latest, windows-latest] # ! FIXME: Add windows | |
python-version: ['3.10'] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Display Python version | |
run: python -c "import sys; print(sys.version)" | |
- name: Update apt package repositories | |
if: matrix.os == 'ubuntu-latest' | |
run: sudo apt-get update | |
- name: Install Linux simpleaudio dependency | |
if: matrix.os == 'ubuntu-latest' | |
run: sudo apt-get install -y python3-dev libasound2-dev | |
- name: Install/Upgrade Python tooling | |
run: python -m pip install --upgrade pip pipenv virtualenv wheel setuptools | |
- id: cache-pipenv | |
uses: actions/cache@v4 | |
with: | |
path: ~/.local/share/virtualenvs | |
key: ${{ runner.os }}-pipenv-${{ hashFiles('**/Pipfile.lock') }} | |
- name: Install dependencies if not in cache | |
run: pipenv install --ignore-pipfile --dev | |
- name: Stupid hack for installing pylint on MacOS | |
if: matrix.os == 'macos-latest' | |
run: pipenv run pip install pylint | |
# - name: Show all dependencies (pipenv) | |
# run: pipenv graph --bare | |
- name: Show all dependencies (pip) | |
run: pipenv run pip list | |
- name: Pre-commit run | |
run: pipenv run pre-commit run --all-files | |
- name: Build the package | |
run: pipenv run python setup.py install --verbose | |
- name: Testing --help | |
run: pipenv run yojenkins --help |