-
Notifications
You must be signed in to change notification settings - Fork 92
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
I accidentally deleted the main CI workflow as a part of b4c1fed. This patch restores the CI workflow.
- Loading branch information
1 parent
41dfda9
commit 6ff14fd
Showing
1 changed file
with
67 additions
and
0 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,67 @@ | ||
# This is a basic workflow to help you get started with Actions | ||
|
||
name: MLGO CI | ||
|
||
on: [push, repository_dispatch, pull_request] | ||
|
||
jobs: | ||
LicenseCheck: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- run: ./check-license.sh | ||
Envvars: | ||
runs-on: ubuntu-latest | ||
outputs: | ||
version_matrix: ${{ steps.set-output.outputs.version_matrix }} | ||
do_cache: ${{ steps.set-output.outputs.do_cache }} | ||
steps: | ||
- id: set-output | ||
run: | | ||
if [ -z $ACT ] | ||
then | ||
_ver="['3.8', '3.9', '3.10']" | ||
_cache="1" | ||
else | ||
# 3.8 instead of '3.8' to make github act work. | ||
_ver="[3.8]" | ||
_cache="0" | ||
fi | ||
echo "version_matrix=$_ver" >> $GITHUB_OUTPUT | ||
echo "do_cache=$_cache" >> $GITHUB_OUTPUT | ||
Checks: | ||
runs-on: ubuntu-latest | ||
needs: [Envvars] | ||
strategy: | ||
matrix: | ||
python-version: ${{ fromJSON(needs.Envvars.outputs.version_matrix) }} | ||
task: [Typecheck, Lint, Yapf, Test] | ||
include: | ||
- task: Typecheck | ||
cmd: pytype -j auto --overriding-parameter-count-checks . | ||
- task: Lint | ||
cmd: pylint --rcfile .pylintrc --recursive yes . | ||
- task: Yapf | ||
cmd: yapf . -drp | ||
- task: Test | ||
cmd: pytest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Install Python With Cached pip Packages | ||
if: needs.Envvars.outputs.do_cache == '1' | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
cache: 'pipenv' | ||
cache-dependency-path: Pipfile.lock | ||
- name: Install Python, no cache | ||
if: needs.Envvars.outputs.do_cache == '0' | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
- name: Install Pipenv | ||
run: pip3 install pipenv | ||
- name: Install Python Dependencies | ||
run: pipenv sync --categories="packages dev-packages ci" --verbose | ||
- name: ${{ matrix.task }} | ||
run: pipenv run ${{ matrix.cmd }} |