From 158165eb3b83b0fce7eab347cbbb6d172b526e3d Mon Sep 17 00:00:00 2001 From: Dennis Scheiba Date: Tue, 12 Dec 2023 12:44:04 +0100 Subject: [PATCH 1/8] run tests in ci --- .github/workflows/python-publish.yml | 49 ++++++++++++++-------------- 1 file changed, 24 insertions(+), 25 deletions(-) diff --git a/.github/workflows/python-publish.yml b/.github/workflows/python-publish.yml index 2f6383c..be1c648 100644 --- a/.github/workflows/python-publish.yml +++ b/.github/workflows/python-publish.yml @@ -1,37 +1,36 @@ -name: Upload Python Package +name: CI on: + pull_request: push: - tags: - - "v*" + branches: [master] permissions: contents: read jobs: deploy: - runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 - - name: Set up Python - uses: actions/setup-python@v3 - with: - python-version: '3.10' - - name: Install dependencies - run: | - python -m pip install --upgrade pip setuptools wheel build pytest - python -m pip install torch torchaudio --index-url https://download.pytorch.org/whl/cpu - python -m pip install -r requirements.txt -# TODO -# - name: Run tests -# run: | -# pytest - - name: Build package - run: RAVE_VERSION=${{ github.ref_name }} python -m build - - name: Publish package - uses: pypa/gh-action-pypi-publish@27b31702a0e7fc50959f5ad993c78deac1bdfc29 - with: - user: __token__ - password: ${{ secrets.PYPI_TOKEN }} + - uses: actions/checkout@v3 + - name: Set up Python + uses: actions/setup-python@v3 + with: + python-version: "3.10" + cache: pip + - name: Install dependencies + run: | + python -m pip install --upgrade pip setuptools wheel build pytest + python -m pip install torch torchaudio --index-url https://download.pytorch.org/whl/cpu + python -m pip install -r requirements.txt + - name: Run tests + run: pytest + - name: Build package + run: RAVE_VERSION=${{ github.ref_name }} python -m build + - name: Publish package + if: startsWith(github.ref, 'refs/tags/v') + uses: pypa/gh-action-pypi-publish@27b31702a0e7fc50959f5ad993c78deac1bdfc29 + with: + user: __token__ + password: ${{ secrets.PYPI_TOKEN }} From ad9dc65b45437a5ee54d5026389a374855d399c1 Mon Sep 17 00:00:00 2001 From: Dennis Scheiba Date: Tue, 12 Dec 2023 12:55:15 +0100 Subject: [PATCH 2/8] split ci runs --- .../{python-publish.yml => actions.yml} | 30 ++++++++++++++++--- .gitignore | 3 +- 2 files changed, 28 insertions(+), 5 deletions(-) rename .github/workflows/{python-publish.yml => actions.yml} (54%) diff --git a/.github/workflows/python-publish.yml b/.github/workflows/actions.yml similarity index 54% rename from .github/workflows/python-publish.yml rename to .github/workflows/actions.yml index be1c648..99ffe84 100644 --- a/.github/workflows/python-publish.yml +++ b/.github/workflows/actions.yml @@ -9,9 +9,8 @@ permissions: contents: read jobs: - deploy: + build: runs-on: ubuntu-latest - steps: - uses: actions/checkout@v3 - name: Set up Python @@ -24,8 +23,6 @@ jobs: python -m pip install --upgrade pip setuptools wheel build pytest python -m pip install torch torchaudio --index-url https://download.pytorch.org/whl/cpu python -m pip install -r requirements.txt - - name: Run tests - run: pytest - name: Build package run: RAVE_VERSION=${{ github.ref_name }} python -m build - name: Publish package @@ -34,3 +31,28 @@ jobs: with: user: __token__ password: ${{ secrets.PYPI_TOKEN }} + + test: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - name: Set up Python + uses: actions/setup-python@v3 + with: + python-version: "3.10" + cache: pip + - name: Install dependencies + run: | + python -m pip install --upgrade pip setuptools wheel build pytest + python -m pip install torch torchaudio --index-url https://download.pytorch.org/whl/cpu + python -m pip install -r requirements.txt + - name: Run tests + continue-on-error: true + run: pytest --junitxml=.test-report.xml + - name: Test Report + uses: dorny/test-reporter@v1 + continue-on-error: true + with: + name: Test reporting + path: .test-report.xml + reporter: java-junit diff --git a/.gitignore b/.gitignore index 3e016e6..06b9a52 100644 --- a/.gitignore +++ b/.gitignore @@ -11,4 +11,5 @@ runs *.yaml *.onnx __version__* -PKG-INFO \ No newline at end of file +PKG-INFO +.junit-test-report.xml From 17373b5d1947e05ccd3c3af4617c1ddb0b72e572 Mon Sep 17 00:00:00 2001 From: Dennis Scheiba Date: Tue, 12 Dec 2023 13:16:05 +0100 Subject: [PATCH 3/8] attaching versioning to code --- .github/workflows/actions.yml | 2 +- rave/__init__.py | 2 ++ rave/version.py | 1 + setup.py | 5 +++-- 4 files changed, 7 insertions(+), 3 deletions(-) create mode 100644 rave/version.py diff --git a/.github/workflows/actions.yml b/.github/workflows/actions.yml index 99ffe84..5a7b8e4 100644 --- a/.github/workflows/actions.yml +++ b/.github/workflows/actions.yml @@ -24,7 +24,7 @@ jobs: python -m pip install torch torchaudio --index-url https://download.pytorch.org/whl/cpu python -m pip install -r requirements.txt - name: Build package - run: RAVE_VERSION=${{ github.ref_name }} python -m build + run: python -m build - name: Publish package if: startsWith(github.ref, 'refs/tags/v') uses: pypa/gh-action-pypi-publish@27b31702a0e7fc50959f5ad993c78deac1bdfc29 diff --git a/rave/__init__.py b/rave/__init__.py index 66ed1c9..ca2eec6 100644 --- a/rave/__init__.py +++ b/rave/__init__.py @@ -5,6 +5,8 @@ import gin import torch +from .version import __version__ + gin.add_config_file_search_path(os.path.dirname(__file__)) gin.add_config_file_search_path( os.path.join( diff --git a/rave/version.py b/rave/version.py new file mode 100644 index 0000000..080e846 --- /dev/null +++ b/rave/version.py @@ -0,0 +1 @@ +__version__ = "3.2" diff --git a/setup.py b/setup.py index 0a67b5e..32c6336 100644 --- a/setup.py +++ b/setup.py @@ -3,7 +3,8 @@ import setuptools -version = os.environ["RAVE_VERSION"] +# imports __version__ +exec(open('rave/version.py').read()) with open("README.md", "r") as readme: readme = readme.read() @@ -13,7 +14,7 @@ setuptools.setup( name="acids-rave", - version=version, + version=__version__, # type: ignore author="Antoine CAILLON", author_email="caillon@ircam.fr", description="RAVE: a Realtime Audio Variatione autoEncoder", From 6ac2868c5b4e319cd715cd3d8d4cea0f50527f6e Mon Sep 17 00:00:00 2001 From: Dennis Scheiba Date: Tue, 12 Dec 2023 13:16:45 +0100 Subject: [PATCH 4/8] add ci permissions for test reports --- .github/workflows/actions.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/actions.yml b/.github/workflows/actions.yml index 5a7b8e4..0104c4a 100644 --- a/.github/workflows/actions.yml +++ b/.github/workflows/actions.yml @@ -1,5 +1,11 @@ name: CI +permissions: + pull-requests: write + issues: write + repository-projects: write + contents: write + on: pull_request: push: From c7f2b555670b66eb83f6319bae8072ae3142ea8a Mon Sep 17 00:00:00 2001 From: Dennis Scheiba Date: Tue, 12 Dec 2023 13:17:54 +0100 Subject: [PATCH 5/8] fix permissions on CI --- .github/workflows/actions.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/workflows/actions.yml b/.github/workflows/actions.yml index 0104c4a..91090d6 100644 --- a/.github/workflows/actions.yml +++ b/.github/workflows/actions.yml @@ -11,9 +11,6 @@ on: push: branches: [master] -permissions: - contents: read - jobs: build: runs-on: ubuntu-latest From b34e9ce130b9db588b5e30282bcf89c729503b2f Mon Sep 17 00:00:00 2001 From: Dennis Scheiba Date: Tue, 12 Dec 2023 13:47:01 +0100 Subject: [PATCH 6/8] separate test reporting --- .github/workflows/actions.yml | 8 +++----- .github/workflows/test-report.yml | 21 +++++++++++++++++++++ 2 files changed, 24 insertions(+), 5 deletions(-) create mode 100644 .github/workflows/test-report.yml diff --git a/.github/workflows/actions.yml b/.github/workflows/actions.yml index 91090d6..371b6c7 100644 --- a/.github/workflows/actions.yml +++ b/.github/workflows/actions.yml @@ -52,10 +52,8 @@ jobs: - name: Run tests continue-on-error: true run: pytest --junitxml=.test-report.xml - - name: Test Report - uses: dorny/test-reporter@v1 - continue-on-error: true + - uses: actions/upload-artifact@v3 + if: success() || failure() with: - name: Test reporting + name: test-report path: .test-report.xml - reporter: java-junit diff --git a/.github/workflows/test-report.yml b/.github/workflows/test-report.yml new file mode 100644 index 0000000..9208b68 --- /dev/null +++ b/.github/workflows/test-report.yml @@ -0,0 +1,21 @@ +name: "Test Report" +on: + workflow_run: + workflows: ["CI"] + types: + - completed + +permissions: + contents: read + actions: read + checks: write +jobs: + report: + runs-on: ubuntu-latest + steps: + - uses: dorny/test-reporter@v1 + with: + artifact: test-report + name: Test report + path: "*.xml" + reporter: jest-junit From cb2d8ba5467b4b20a8ec960ec9a86d4a3672727f Mon Sep 17 00:00:00 2001 From: Dennis Scheiba Date: Tue, 12 Dec 2023 13:52:27 +0100 Subject: [PATCH 7/8] fail ci test run if tests fail --- .github/workflows/actions.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/actions.yml b/.github/workflows/actions.yml index 371b6c7..c99f097 100644 --- a/.github/workflows/actions.yml +++ b/.github/workflows/actions.yml @@ -50,7 +50,6 @@ jobs: python -m pip install torch torchaudio --index-url https://download.pytorch.org/whl/cpu python -m pip install -r requirements.txt - name: Run tests - continue-on-error: true run: pytest --junitxml=.test-report.xml - uses: actions/upload-artifact@v3 if: success() || failure() From 3df70c941addd597f561fa02036d75bbd4bdf3eb Mon Sep 17 00:00:00 2001 From: Dennis Scheiba Date: Tue, 12 Dec 2023 14:18:59 +0100 Subject: [PATCH 8/8] set version to 2.3.0 --- rave/version.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rave/version.py b/rave/version.py index 080e846..55e4709 100644 --- a/rave/version.py +++ b/rave/version.py @@ -1 +1 @@ -__version__ = "3.2" +__version__ = "2.3.0"