-
Notifications
You must be signed in to change notification settings - Fork 106
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.
PiperOrigin-RevId: 551926076 Change-Id: Ia7b79bfeba2e7ff579aa125dbf4dc992d37b0eaa
- Loading branch information
Showing
8 changed files
with
167 additions
and
70 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: 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,22 @@ | ||
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: Install Python dependencies | ||
shell: bash | ||
run: | | ||
pip install --upgrade pip | ||
pip install --editable .[dev] |
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,45 @@ | ||
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@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 | ||
|
||
- 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
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,45 @@ | ||
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@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 | ||
|
||
- 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
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 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