Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ on:
branches:
- "**"

permissions:
contents: read

jobs:
test:
runs-on: ubuntu-latest
Expand All @@ -26,10 +29,10 @@ jobs:

steps:
- name: Clone
uses: actions/checkout@v6
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2

- name: Python
uses: actions/setup-python@v6
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
with:
python-version: ${{ matrix.python }}
architecture: x64
Expand All @@ -49,7 +52,7 @@ jobs:
run: make test-all OPT="--dtype double"

- name: Coverage
uses: codecov/codecov-action@v5
uses: codecov/codecov-action@57e3a136b779b570ffcdbf80b3bdc90e7fab3de2 # v6.0.0
with:
fail_ci_if_error: true
files: ./coverage.xml
Expand Down
10 changes: 7 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,15 @@ TORCH_VERSION := 2.3.1
TORCHAUDIO_VERSION := 2.3.1
PLATFORM := cu121

PIP_TIME_LIMIT := --uploaded-prior-to=$(shell date -u -d '14 days ago' '+%Y-%m-%dT%H:%M:%SZ')

venv:
test -d .venv || python$(PYTHON_VERSION) -m venv .venv
. .venv/bin/activate && python -m pip install --upgrade pip
. .venv/bin/activate && python -m pip install --upgrade wheel
. .venv/bin/activate && python -m pip install --upgrade wheel $(PIP_TIME_LIMIT)
. .venv/bin/activate && python -m pip install torch==$(TORCH_VERSION)+$(PLATFORM) torchaudio==$(TORCHAUDIO_VERSION)+$(PLATFORM) \
--index-url https://download.pytorch.org/whl/$(PLATFORM)
. .venv/bin/activate && python -m pip install -e .[dev]
. .venv/bin/activate && python -m pip install -e .[dev] $(PIP_TIME_LIMIT)

dist:
. .venv/bin/activate && python -m build
Expand All @@ -52,13 +54,15 @@ check: tool
. .venv/bin/activate && python -m mdformat --check *.md
.venv/bin/codespell
./tools/taplo/taplo fmt --check *.toml
./tools/pinact/pinact run --check .github/workflows/*.yml
./tools/yamlfmt/yamlfmt --lint *.cff *.yml .github/workflows/*.yml

format: tool
. .venv/bin/activate && python -m ruff check --fix $(PROJECT) tests
. .venv/bin/activate && python -m ruff format $(PROJECT) tests docs/source
. .venv/bin/activate && python -m mdformat *.md
./tools/taplo/taplo fmt *.toml
./tools/pinact/pinact run -u --min-age 14 .github/workflows/*.yml
./tools/yamlfmt/yamlfmt *.cff *.yml .github/workflows/*.yml

test-all: test-example test
Expand Down Expand Up @@ -86,7 +90,7 @@ tool-clean:
update: tool
. .venv/bin/activate && python -m pip install --upgrade pip
@./tools/taplo/taplo get -f pyproject.toml project.optional-dependencies.dev | while read -r package; do \
. .venv/bin/activate && python -m pip install --upgrade "$$package"; \
. .venv/bin/activate && python -m pip install --upgrade "$$package" $(PIP_TIME_LIMIT); \
done

clean: dist-clean doc-clean test-clean tool-clean
Expand Down
11 changes: 9 additions & 2 deletions tools/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,22 @@
# limitations under the License. #
# ------------------------------------------------------------------------ #

PINACT_VERSION := 3.10.1
TAPLO_VERSION := 0.10.0
YAMLFMT_VERSION := 0.21.0

all: SPTK taplo yamlfmt
all: SPTK pinact taplo yamlfmt

SPTK:
git clone https://github.com/sp-nitech/SPTK.git
cd SPTK && make

pinact:
mkdir -p pinact
wget https://github.com/suzuki-shunsuke/pinact/releases/download/v$(PINACT_VERSION)/pinact_linux_amd64.tar.gz -O pinact.tar.gz
tar xzf pinact.tar.gz -C pinact
rm -f pinact.tar.gz

taplo:
mkdir -p taplo
wget https://github.com/tamasfe/taplo/releases/download/$(TAPLO_VERSION)/taplo-linux-x86_64.gz -O taplo.gz
Expand All @@ -37,6 +44,6 @@ yamlfmt:
rm -f yamlfmt.tar.gz

clean:
rm -rf SPTK taplo yamlfmt
rm -rf SPTK pinact taplo yamlfmt

.PHONY: all clean