Skip to content

Commit 5dbea18

Browse files
authored
Merge pull request #289 from tky823/tests/build-status
Set permissions in workflows
2 parents 0b54e0d + 432d1ab commit 5dbea18

28 files changed

+220
-35
lines changed

.github/workflows/lint.yaml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: lint
2+
on:
3+
push:
4+
branches:
5+
- main
6+
pull_request:
7+
branches:
8+
- main
9+
jobs:
10+
lint:
11+
name: Run linters
12+
runs-on: ubuntu-latest
13+
steps:
14+
- name: Checkout
15+
uses: actions/checkout@v4
16+
- name: Set up Python 3.12
17+
uses: actions/setup-python@v4
18+
with:
19+
python-version: "3.12"
20+
- name: Install dependencies
21+
run: |
22+
python -m pip install --upgrade pip
23+
pip install ".[dev]"
24+
- name: Run linters
25+
run: |
26+
# See pyproject.toml
27+
isort --line-length 100 ssspy tests
28+
flake8 --max-line-length=100 --ignore=E203,W503,W504 --exclude ssspy/_version.py ssspy tests
29+
- name: Run formatters
30+
run: |
31+
python -m black --config pyproject.toml --check ssspy tests

.github/workflows/test_docs.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,10 @@ jobs:
1313
steps:
1414
- name: Checkout
1515
uses: actions/checkout@v4
16-
- name: Set up Python 3.11
16+
- name: Set up Python 3.12
1717
uses: actions/setup-python@v4
1818
with:
19-
python-version: "3.11"
19+
python-version: "3.12"
2020
- name: Install dependencies
2121
run: |
2222
sudo apt-get update

.github/workflows/test_package_macos-13.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ on:
66
required: true
77
type: string
88
secrets:
9+
CODECOV_TOKEN:
10+
required: true
911
TEST_PYPI_API_TOKEN:
1012
required: true
1113
jobs:
@@ -17,4 +19,7 @@ jobs:
1719
os: macos-13
1820
python-version: ${{ inputs.python-version }}
1921
secrets:
22+
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
2023
TEST_PYPI_API_TOKEN: ${{ secrets.TEST_PYPI_API_TOKEN }}
24+
permissions:
25+
id-token: write

.github/workflows/test_package_macos-13_python-3.10.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,7 @@ jobs:
1212
with:
1313
python-version: "3.10"
1414
secrets:
15+
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
1516
TEST_PYPI_API_TOKEN: ${{ secrets.TEST_PYPI_API_TOKEN }}
17+
permissions:
18+
id-token: write

.github/workflows/test_package_macos-13_python-3.11.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,7 @@ jobs:
1212
with:
1313
python-version: "3.11"
1414
secrets:
15+
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
1516
TEST_PYPI_API_TOKEN: ${{ secrets.TEST_PYPI_API_TOKEN }}
17+
permissions:
18+
id-token: write

.github/workflows/test_package_macos-13_python-3.12.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,7 @@ jobs:
1212
with:
1313
python-version: "3.12"
1414
secrets:
15+
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
1516
TEST_PYPI_API_TOKEN: ${{ secrets.TEST_PYPI_API_TOKEN }}
17+
permissions:
18+
id-token: write

.github/workflows/test_package_macos-13_python-3.8.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,7 @@ jobs:
1212
with:
1313
python-version: "3.8"
1414
secrets:
15+
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
1516
TEST_PYPI_API_TOKEN: ${{ secrets.TEST_PYPI_API_TOKEN }}
17+
permissions:
18+
id-token: write

.github/workflows/test_package_macos-13_python-3.9.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,7 @@ jobs:
1212
with:
1313
python-version: "3.9"
1414
secrets:
15+
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
1516
TEST_PYPI_API_TOKEN: ${{ secrets.TEST_PYPI_API_TOKEN }}
17+
permissions:
18+
id-token: write
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
name: macos-latest
2+
on:
3+
workflow_call:
4+
inputs:
5+
python-version:
6+
required: true
7+
type: string
8+
secrets:
9+
CODECOV_TOKEN:
10+
required: true
11+
TEST_PYPI_API_TOKEN:
12+
required: true
13+
jobs:
14+
package:
15+
uses: ./.github/workflows/test_package_main.yaml
16+
with:
17+
# macos-13: x86_64, macos-latest: arm
18+
# See https://docs.github.com/en/actions/using-github-hosted-runners/about-github-hosted-runners/about-github-hosted-runners
19+
os: macos-latest
20+
python-version: ${{ inputs.python-version }}
21+
secrets:
22+
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
23+
TEST_PYPI_API_TOKEN: ${{ secrets.TEST_PYPI_API_TOKEN }}
24+
permissions:
25+
id-token: write
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
name: macos-latest/3.10
2+
on:
3+
push:
4+
branches:
5+
- main
6+
pull_request:
7+
branches:
8+
- main
9+
jobs:
10+
package:
11+
uses: ./.github/workflows/test_package_macos-latest.yaml
12+
with:
13+
python-version: "3.10"
14+
secrets:
15+
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
16+
TEST_PYPI_API_TOKEN: ${{ secrets.TEST_PYPI_API_TOKEN }}
17+
permissions:
18+
id-token: write

0 commit comments

Comments
 (0)