Skip to content

Commit

Permalink
Clean workflow files (#5360)
Browse files Browse the repository at this point in the history
  • Loading branch information
kan-bayashi committed Jul 23, 2023
1 parent e2a0077 commit 890ba71
Show file tree
Hide file tree
Showing 16 changed files with 140 additions and 128 deletions.
13 changes: 0 additions & 13 deletions .github/workflows/cancel.yml

This file was deleted.

29 changes: 29 additions & 0 deletions .github/workflows/cancel_workflows.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: cancel workflows
on:
workflow_run:
workflows:
- "ci on ubuntu"
- "ci on centos7"
- "ci on debian11"
- "ci on macos"
- "ci on windows"
- "publish doc"
- "publish paper pdf"
# TODO(kan-bayashi): Remove the following items once all PR used new workflow files
- "CI"
- "centos7"
- "debian11"
- "doc"
- "MacOS"
- "Windows"
- "Test import espnet"
- "Check kaldi scripts"
types:
- requested
jobs:
cancel:
runs-on: ubuntu-latest
steps:
- uses: styfle/cancel-workflow-action@0.11.0
with:
workflow_id: ${{ github.event.workflow.id }}
16 changes: 0 additions & 16 deletions .github/workflows/check_kaldi_symlinks.yaml

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: centos7
name: ci on centos7

on:
push:
Expand All @@ -9,7 +9,7 @@ on:
- master

jobs:
test_centos7:
unit_test_espnet1_and_espnet2_on_centos7:
runs-on: ubuntu-latest
if: github.event.pull_request.draft == false
container:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: debian11
name: ci on debian11

on:
push:
Expand All @@ -9,7 +9,7 @@ on:
- master

jobs:
test_debian11:
unit_test_espnet1_and_espnet2_on_debian11:
runs-on: ubuntu-latest
if: github.event.pull_request.draft == false
container:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: MacOS
name: ci on macos

on:
push:
Expand All @@ -9,7 +9,7 @@ on:
- master

jobs:
test_macos:
check_installable_on_macos:
runs-on: macOS-latest
if: github.event.pull_request.draft == false
strategy:
Expand Down
63 changes: 60 additions & 3 deletions .github/workflows/ci.yaml → .github/workflows/ci_on_ubuntu.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: CI
name: ci on ubuntu

on:
push:
Expand Down Expand Up @@ -26,7 +26,7 @@ jobs:
echo "is_docker=false" >> "$GITHUB_OUTPUT"
fi
linter_and_test_espnet1:
unit_test_espnet1_and_integration_test_espnet1:
runs-on: ${{ matrix.os }}
needs: process_labels
# Outputs from Previous jobs are strings. Take care in case of using True/False.
Expand Down Expand Up @@ -96,7 +96,7 @@ jobs:
with:
flags: test_integration_espnet1

linter_and_test_espnet2:
unit_test_espnet2_and_integration_test_espnet2:
runs-on: ${{ matrix.os }}
needs: process_labels
if: |
Expand Down Expand Up @@ -239,3 +239,60 @@ jobs:
- uses: codecov/codecov-action@v2
with:
flags: test_configuration_espnet2

test_import:
runs-on: ${{ matrix.os }}
needs: process_labels
if: |
github.event.pull_request.draft == false &&
needs.process_labels.outputs.is_docker == 'false'
strategy:
max-parallel: 20
matrix:
os: [ubuntu-latest]
python-version: ["3.10"]
pytorch-version: [1.13.1]
steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v1
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
sudo apt-get install -qq -y libsndfile1-dev
python3 -m pip install --upgrade pip setuptools wheel
- name: Install espnet with the least requirement
env:
TH_VERSION: ${{ matrix.pytorch-version }}
run: |
python3 -m pip install -U numba
./tools/installers/install_torch.sh false ${TH_VERSION} CPU
./tools/installers/install_chainer.sh CPU
python3 setup.py bdist_wheel
python3 -m pip install dist/espnet-*.whl
# log
python3 -m pip freeze
- name: Import all modules (Try1)
run: |
python3 ./ci/test_import_all.py
- name: Install espnet with the full requirement
env:
TH_VERSION: ${{ matrix.pytorch-version }}
run: |
python3 -m pip install "$(ls dist/espnet-*.whl)[all]"
# log
python3 -m pip freeze
- name: Import all modules (Try2)
run: |
python3 ./ci/test_import_all.py
check_kaldi_symlinks:
runs-on: ubuntu-latest
needs: process_labels
if: |
github.event.pull_request.draft == false &&
needs.process_labels.outputs.is_docker == 'false'
steps:
- uses: actions/checkout@master
- run: ci/check_kaldi_symlinks.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Windows
name: ci on windows

on:
push:
Expand All @@ -9,7 +9,7 @@ on:
- master

jobs:
test_windows:
check_installable_on_windows:
runs-on: Windows-latest
if: github.event.pull_request.draft == false
strategy:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: doc
name: publish doc

on:
push:
Expand Down Expand Up @@ -26,7 +26,7 @@ jobs:
echo "is_doc=false" >> "$GITHUB_OUTPUT"
fi
linter_and_test:
generate_and_deplay_doc:
runs-on: ubuntu-latest
needs: get_labels
if: |
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: docker-builder
name: publich docker image

on:
pull_request:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,17 @@
on: [push]
name: publish paper pdf

on:
push:
branches:
- master
pull_request:
branches:
- master

jobs:
paper:
generate_and_upload_paper_pdf:
runs-on: ubuntu-latest
if: github.event.pull_request.draft == false
name: Paper Draft
steps:
- name: Checkout
uses: actions/checkout@v2
Expand Down
Original file line number Diff line number Diff line change
@@ -1,18 +1,16 @@
# This workflows will upload a Python Package using Twine when a release is created
# For more information see: https://help.github.com/en/actions/language-and-framework-guides/using-python-with-github-actions#publishing-to-package-registries

name: Upload Python Package
name: publish python package

on:
push:
tags:
- 'v*'

jobs:
deploy:

publish_python_package_to_pypi:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: Set up Python
Expand Down
54 changes: 0 additions & 54 deletions .github/workflows/test_import.yaml

This file was deleted.

27 changes: 15 additions & 12 deletions .mergify.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,21 @@ pull_request_rules:
- name: automatic merge if label=auto-merge
conditions:
- "label=auto-merge"
- "check-success=test_centos7"
- "check-success=test_debian11"
- "check-success=linter_and_test_espnet1 (ubuntu-latest, 3.7, 1.10.2, false, 6.0.0)"
- "check-success=linter_and_test_espnet1 (ubuntu-latest, 3.10, 1.13.1, 6.0.0, false)"
- "check-success=linter_and_test_espnet2 (ubuntu-latest, 3.7, 1.10.2, 6.0.0, false)"
- "check-success=linter_and_test_espnet2 (ubuntu-latest, 3.7, 1.11.0, 6.0.0, false)"
- "check-success=linter_and_test_espnet2 (ubuntu-latest, 3.7, 1.12.1, 6.0.0, false)"
- "check-success=linter_and_test_espnet2 (ubuntu-latest, 3.7, 1.13.1, 6.0.0, false)"
- "check-success=linter_and_test_espnet2 (ubuntu-latest, 3.8, 1.13.1, false, 6.0.0)"
- "check-success=linter_and_test_espnet2 (ubuntu-latest, 3.9, 1.13.1, false, 6.0.0)"
- "check-success=linter_and_test_espnet2 (ubuntu-latest, 3.10, 1.13.1, false, 6.0.0)"
- "check-success=test_configuration_espnet2 (ubuntu-latest, 3.7, 1.10.2, 6.0.0, false"
- "check-success=unit_test_espnet1_and_espnet2_on_centos7"
- "check-success=unit_test_espnet1_and_espnet2_on_debian11"
- "check-success=check_installable_on_windows (3.10, 1.13.1)"
- "check-success=check_installable_on_macos (3.10, 1.13.1, true)"
- "check-success=check_installable_on_macos (3.10, 1.13.1, false)"
- "check-success=unit_test_espnet1_and_integration_test_espnet1 (ubuntu-latest, 3.7, 1.10.2, false, 6.0.0)"
- "check-success=unit_test_espnet1_and_integration_test_espnet1 (ubuntu-latest, 3.10, 1.13.1, 6.0.0, false)"
- "check-success=unit_test_espnet2_and_integration_test_espnet2 (ubuntu-latest, 3.7, 1.10.2, 6.0.0, false)"
- "check-success=unit_test_espnet2_and_integration_test_espnet2 (ubuntu-latest, 3.7, 1.11.0, 6.0.0, false)"
- "check-success=unit_test_espnet2_and_integration_test_espnet2 (ubuntu-latest, 3.7, 1.12.1, 6.0.0, false)"
- "check-success=unit_test_espnet2_and_integration_test_espnet2 (ubuntu-latest, 3.7, 1.13.1, 6.0.0, false)"
- "check-success=unit_test_espnet2_and_integration_test_espnet2 (ubuntu-latest, 3.8, 1.13.1, false, 6.0.0)"
- "check-success=unit_test_espnet2_and_integration_test_espnet2 (ubuntu-latest, 3.9, 1.13.1, false, 6.0.0)"
- "check-success=unit_test_espnet2_and_integration_test_espnet2 (ubuntu-latest, 3.10, 1.13.1, false, 6.0.0)"
- "check-success=test_configuration_espnet2 (ubuntu-latest, 3.7, 1.10.2, 6.0.0, false)"
- "check-success=test_configuration_espnet2 (ubuntu-latest, 3.10, 1.13.1, false, 6.0.0)"
- "check-success=test_import (ubuntu-latest, 3.10, 1.13.1)"
- "check-success=check_kaldi_symlinks"
Expand Down
6 changes: 4 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,8 @@ In order to thoroughly test various units, it is necessary to install several mo

Then, you can run the entire test suite using [pytest](https://docs.pytest.org/en/latest/) with [coverage](https://pytest-cov.readthedocs.io/en/latest/reporting.html) by
``` console
./ci/test_python.sh
./ci/test_python_espnet1.sh
./ci/test_python_espnet2.sh
```
The followings are some useful tips when you are using `pytest`:
- New test file should be put under `test/` directory and named `test_xxx.py`. Each method in the test file should
Expand All @@ -153,7 +154,8 @@ You can also test the scripts in `utils` with [bats-core](https://github.com/bat
To test:

``` console
./ci/test_shell.sh
./ci/test_shell_espnet1.sh
./ci/test_shell_espnet2.sh
```

## 5 Integration testing
Expand Down

0 comments on commit 890ba71

Please sign in to comment.