Skip to content

Commit d020149

Browse files
authored
Merge pull request #163 from sp-nitech/attack [skip ci]
Maintenance
2 parents 01966ca + 88d69f1 commit d020149

3 files changed

Lines changed: 22 additions & 8 deletions

File tree

.github/workflows/ci.yml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@ on:
99
branches:
1010
- "**"
1111

12+
permissions:
13+
contents: read
14+
1215
jobs:
1316
test:
1417
runs-on: ubuntu-latest
@@ -26,10 +29,10 @@ jobs:
2629

2730
steps:
2831
- name: Clone
29-
uses: actions/checkout@v6
32+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
3033

3134
- name: Python
32-
uses: actions/setup-python@v6
35+
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
3336
with:
3437
python-version: ${{ matrix.python }}
3538
architecture: x64
@@ -49,7 +52,7 @@ jobs:
4952
run: make test-all OPT="--dtype double"
5053

5154
- name: Coverage
52-
uses: codecov/codecov-action@v5
55+
uses: codecov/codecov-action@57e3a136b779b570ffcdbf80b3bdc90e7fab3de2 # v6.0.0
5356
with:
5457
fail_ci_if_error: true
5558
files: ./coverage.xml

Makefile

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,15 @@ TORCH_VERSION := 2.3.1
2323
TORCHAUDIO_VERSION := 2.3.1
2424
PLATFORM := cu121
2525

26+
PIP_TIME_LIMIT := --uploaded-prior-to=$(shell date -u -d '14 days ago' '+%Y-%m-%dT%H:%M:%SZ')
27+
2628
venv:
2729
test -d .venv || python$(PYTHON_VERSION) -m venv .venv
2830
. .venv/bin/activate && python -m pip install --upgrade pip
29-
. .venv/bin/activate && python -m pip install --upgrade wheel
31+
. .venv/bin/activate && python -m pip install --upgrade wheel $(PIP_TIME_LIMIT)
3032
. .venv/bin/activate && python -m pip install torch==$(TORCH_VERSION)+$(PLATFORM) torchaudio==$(TORCHAUDIO_VERSION)+$(PLATFORM) \
3133
--index-url https://download.pytorch.org/whl/$(PLATFORM)
32-
. .venv/bin/activate && python -m pip install -e .[dev]
34+
. .venv/bin/activate && python -m pip install -e .[dev] $(PIP_TIME_LIMIT)
3335

3436
dist:
3537
. .venv/bin/activate && python -m build
@@ -52,13 +54,15 @@ check: tool
5254
. .venv/bin/activate && python -m mdformat --check *.md
5355
.venv/bin/codespell
5456
./tools/taplo/taplo fmt --check *.toml
57+
./tools/pinact/pinact run --check .github/workflows/*.yml
5558
./tools/yamlfmt/yamlfmt --lint *.cff *.yml .github/workflows/*.yml
5659

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

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

9296
clean: dist-clean doc-clean test-clean tool-clean

tools/Makefile

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,22 @@
1414
# limitations under the License. #
1515
# ------------------------------------------------------------------------ #
1616

17+
PINACT_VERSION := 3.10.1
1718
TAPLO_VERSION := 0.10.0
1819
YAMLFMT_VERSION := 0.21.0
1920

20-
all: SPTK taplo yamlfmt
21+
all: SPTK pinact taplo yamlfmt
2122

2223
SPTK:
2324
git clone https://github.com/sp-nitech/SPTK.git
2425
cd SPTK && make
2526

27+
pinact:
28+
mkdir -p pinact
29+
wget https://github.com/suzuki-shunsuke/pinact/releases/download/v$(PINACT_VERSION)/pinact_linux_amd64.tar.gz -O pinact.tar.gz
30+
tar xzf pinact.tar.gz -C pinact
31+
rm -f pinact.tar.gz
32+
2633
taplo:
2734
mkdir -p taplo
2835
wget https://github.com/tamasfe/taplo/releases/download/$(TAPLO_VERSION)/taplo-linux-x86_64.gz -O taplo.gz
@@ -37,6 +44,6 @@ yamlfmt:
3744
rm -f yamlfmt.tar.gz
3845

3946
clean:
40-
rm -rf SPTK taplo yamlfmt
47+
rm -rf SPTK pinact taplo yamlfmt
4148

4249
.PHONY: all clean

0 commit comments

Comments
 (0)