Skip to content

Commit

Permalink
Merge pull request #333 from YuukiToriyama/feature/rust-cache/master
Browse files Browse the repository at this point in the history
rust-cacheの導入をmainブランチにマージ
  • Loading branch information
YuukiToriyama authored Jul 5, 2024
2 parents d3f6f44 + 3cb036f commit b7e2a45
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 3 deletions.
7 changes: 7 additions & 0 deletions .github/workflows/code-check.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,13 @@ jobs:

steps:
- uses: actions/checkout@v4
- uses: Swatinem/rust-cache@v2
with:
cache-all-crates: true
shared-key: 'test-on-pr'
key: 'main'
save-if: ${{ github.ref == 'refs/heads/main' }} # mainブランチにコミットが追加された時のみキャッシュを保存する
cache-provider: 'github'
- name: Set up clippy
run: rustup component add clippy
- name: Code review with clippy
Expand Down
33 changes: 30 additions & 3 deletions .github/workflows/python-build-check.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ name: Python module build check

on:
pull_request:
push:
branches: [ 'main' ]

permissions:
contents: read
Expand All @@ -11,6 +13,13 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: Swatinem/rust-cache@v2
with:
cache-all-crates: true
shared-key: 'maturin-linux'
key: 'main'
save-if: ${{ github.ref == 'refs/heads/main' }} # mainブランチにコミットが追加された時のみキャッシュを保存する
cache-provider: 'github'
- uses: actions/setup-python@v5
with:
python-version: '3.10'
Expand All @@ -20,13 +29,19 @@ jobs:
target: x86_64
args: --release --out dist --zig
working-directory: python
sccache: 'true'
manylinux: auto

windows:
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
- uses: Swatinem/rust-cache@v2
with:
cache-all-crates: true
shared-key: 'maturin-windows'
key: 'main'
save-if: ${{ github.ref == 'refs/heads/main' }} # mainブランチにコミットが追加された時のみキャッシュを保存する
cache-provider: 'github'
- uses: actions/setup-python@v5
with:
python-version: '3.10'
Expand All @@ -37,12 +52,18 @@ jobs:
target: x64
args: --release --out dist
working-directory: python
sccache: 'true'

macos:
runs-on: macos-14
steps:
- uses: actions/checkout@v4
- uses: Swatinem/rust-cache@v2
with:
cache-all-crates: true
shared-key: 'maturin-macos'
key: 'main'
save-if: ${{ github.ref == 'refs/heads/main' }} # mainブランチにコミットが追加された時のみキャッシュを保存する
cache-provider: 'github'
- uses: actions/setup-python@v5
with:
python-version: '3.10'
Expand All @@ -52,12 +73,18 @@ jobs:
target: aarch64
args: --release --out dist
working-directory: python
sccache: 'true'

sdist:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: Swatinem/rust-cache@v2
with:
cache-all-crates: true
shared-key: 'maturin-sdist'
key: 'main'
save-if: ${{ github.ref == 'refs/heads/main' }} # mainブランチにコミットが追加された時のみキャッシュを保存する
cache-provider: 'github'
- name: Build sdist
uses: PyO3/maturin-action@v1
with:
Expand Down
7 changes: 7 additions & 0 deletions .github/workflows/wasm-pack-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,13 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: Swatinem/rust-cache@v2
with:
cache-all-crates: true
shared-key: 'wasm-pack'
key: 'main'
save-if: ${{ github.ref == 'refs/heads/main' }} # mainブランチにコミットが追加された時のみキャッシュを保存する
cache-provider: 'github'
- name: Install wasm-pack
run: curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh
- name: Unit test for core module
Expand Down

0 comments on commit b7e2a45

Please sign in to comment.