forked from google-deepmind/meltingpot
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update workflows to use composite actions
- Loading branch information
Showing
12 changed files
with
275 additions
and
140 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,15 @@ | ||
name: install-examples | ||
|
||
runs: | ||
using: composite | ||
steps: | ||
- name: Install Melting Pot | ||
uses: ./.github/actions/install-meltingpot | ||
- name: Install requirements for examples | ||
shell: bash | ||
run: pip -r examples/requirements.txt | ||
- name: Show installed dependencies | ||
shell: bash | ||
run: | | ||
which python | ||
pip list |
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 @@ | ||
name: install-meltingpot | ||
|
||
inputs: | ||
python-version: | ||
description: Python version | ||
required: false | ||
default: '3.10' | ||
type: string | ||
|
||
runs: | ||
using: composite | ||
steps: | ||
- name: Set up Python ${{ inputs.python-version }} | ||
uses: actions/setup-python@61a6322f88396a6271a6ee3565807d608ecaddd1 | ||
with: | ||
python-version: ${{ inputs.python-version }} | ||
|
||
- name: Restore install cache | ||
id: cache-restore | ||
uses: actions/cache/restore@v3 | ||
with: | ||
path: | | ||
assets | ||
meltingpot/assets | ||
venv | ||
key: install-meltingpot-${{ runner.name }}-py${{ inputs.python-version}}-${{ hashFiles('setup.py') }} | ||
restore-keys: | ||
install-meltingpot-${{ runner.name }}-py${{ inputs.python-version }} | ||
|
||
- name: Install Python dependencies | ||
if: steps.cache.outputs.cache-hit != 'true' | ||
shell: bash | ||
run: | | ||
pip install --upgrade pip | ||
pip install virtualenv | ||
virtualenv venv | ||
source venv/bin/activate | ||
pip install -e .[dev] | ||
- name: Save install cache | ||
uses: actions/cache/save@v3 | ||
with: | ||
path: | | ||
assets | ||
venv | ||
meltingpot/assets | ||
key: ${{ steps.cache-restore.outputs.cache-primary-key }} | ||
|
||
- name: Show installed dependencies | ||
shell: bash | ||
run: | | ||
source venv/bin/activate | ||
which python | ||
which pytest | ||
which pylint | ||
which pytype | ||
which isort | ||
pip list | ||
- name: Debug | ||
shell: bash | ||
run: | | ||
which python | ||
which pytest | ||
which pylint | ||
which pytype | ||
which isort |
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,43 @@ | ||
name: pylint-examples | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
paths: | ||
- '.github/actions/install-examples/action.yml' | ||
- '.github/actions/install-meltingpot/action.yml' | ||
- '.github/workflows/pylint-examples.yml' | ||
- '.pylintrc' | ||
- 'examples/**' | ||
- 'meltingpot/**' | ||
pull_request: | ||
branches: | ||
- main | ||
paths: | ||
- '.github/actions/install-examples/action.yml' | ||
- '.github/actions/install-meltingpot/action.yml' | ||
- '.github/workflows/pylint-examples.yml' | ||
- '.pylintrc' | ||
- 'examples/**' | ||
- 'meltingpot/**' | ||
workflow_dispatch: | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.head_ref || github.ref }} | ||
cancel-in-progress: true | ||
|
||
permissions: read-all | ||
|
||
jobs: | ||
pylint: | ||
name: Lint examples | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 5 | ||
steps: | ||
- name: Checkout Melting Pot | ||
uses: actions/checkout@8f4b7f84864484a7bf31766abe9204da3cbe65b3 | ||
- name: Install examples | ||
uses: ./.github/actions/install-examples | ||
- name: Run PyLint on examples | ||
run: pylint --errors-only examples |
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,41 @@ | ||
name: pylint-meltingpot | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
paths: | ||
- '.github/actions/install-meltingpot/action.yml' | ||
- '.github/workflows/pylint-meltingpot.yml' | ||
- '.pylintrc' | ||
- 'examples/**' | ||
- 'meltingpot/**' | ||
pull_request: | ||
branches: | ||
- main | ||
paths: | ||
- '.github/actions/install-meltingpot/action.yml' | ||
- '.github/workflows/pylint-meltingpot.yml' | ||
- '.pylintrc' | ||
- 'examples/**' | ||
- 'meltingpot/**' | ||
workflow_dispatch: | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.head_ref || github.ref }} | ||
cancel-in-progress: true | ||
|
||
permissions: read-all | ||
|
||
jobs: | ||
pylint: | ||
name: Lint Melting Pot | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 30 | ||
steps: | ||
- name: Checkout Melting Pot | ||
uses: actions/checkout@8f4b7f84864484a7bf31766abe9204da3cbe65b3 | ||
- name: Install Melting Pot | ||
uses: ./.github/actions/install-meltingpot | ||
- name: Run PyLint on Melting Pot | ||
run: pylint --errors-only meltingpot |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
name: pytype-examples | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
paths: | ||
- '.github/actions/install-examples/action.yml' | ||
- '.github/actions/install-meltingpot/action.yml' | ||
- '.github/workflows/pytype-examples.yml' | ||
- 'examples/**' | ||
- 'meltingpot/**' | ||
- 'pyproject.toml' | ||
pull_request: | ||
branches: | ||
- main | ||
paths: | ||
- '.github/actions/install-examples/action.yml' | ||
- '.github/actions/install-meltingpot/action.yml' | ||
- '.github/workflows/pytype-examples.yml' | ||
- 'examples/**' | ||
- 'meltingpot/**' | ||
- 'pyproject.toml' | ||
workflow_dispatch: | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.head_ref || github.ref }} | ||
cancel-in-progress: true | ||
|
||
permissions: read-all | ||
|
||
jobs: | ||
pytype: | ||
name: Typecheck examples | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 30 | ||
steps: | ||
- name: Checkout Melting Pot | ||
uses: actions/checkout@8f4b7f84864484a7bf31766abe9204da3cbe65b3 | ||
- name: Install examples | ||
uses: ./.github/actions/install-examples | ||
- name: Run PyType on examples | ||
run: pytype examples |
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,41 @@ | ||
name: pytype-meltingpot | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
paths: | ||
- '.github/actions/install-meltingpot/action.yml' | ||
- '.github/workflows/pytype-meltingpot.yml' | ||
- 'examples/**' | ||
- 'meltingpot/**' | ||
- 'pyproject.toml' | ||
pull_request: | ||
branches: | ||
- main | ||
paths: | ||
- '.github/actions/install-meltingpot/action.yml' | ||
- '.github/workflows/pytype-meltingpot.yml' | ||
- 'examples/**' | ||
- 'meltingpot/**' | ||
- 'pyproject.toml' | ||
workflow_dispatch: | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.head_ref || github.ref }} | ||
cancel-in-progress: true | ||
|
||
permissions: read-all | ||
|
||
jobs: | ||
pytype: | ||
name: Typecheck Melting Pot | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 30 | ||
steps: | ||
- name: Checkout Melting Pot | ||
uses: actions/checkout@8f4b7f84864484a7bf31766abe9204da3cbe65b3 | ||
- name: Install Melting Pot | ||
uses: ./.github/actions/install-meltingpot | ||
- name: Run PyType on Melting Pot | ||
run: pytype meltingpot |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.