-
-
Notifications
You must be signed in to change notification settings - Fork 3
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
2b73de2
commit 4d7f6a7
Showing
8 changed files
with
143 additions
and
210 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 |
---|---|---|
@@ -0,0 +1,95 @@ | ||
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@v3 | ||
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 'YAPF_CHECKER@users.noreply.github.com' | ||
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@v3 | ||
- 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@v3 | ||
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 |
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
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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
Oops, something went wrong.