diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 27b70242..055cddd6 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -15,15 +15,6 @@ jobs: python-version: ['3.7', '3.8', '3.9', '3.10', '3.11', '3.12'] steps: - uses: actions/checkout@v3 - - uses: actions/cache@v3 - with: - path: | - ~/.cargo/bin/ - ~/.cargo/registry/index/ - ~/.cargo/registry/cache/ - ~/.cargo/git/db/ - target/ - key: ${{ runner.os }}-${{ matrix.python-version }}-cargo-${{ hashFiles('**/Cargo.lock') }} - uses: actions/setup-python@v5 with: python-version: ${{ matrix.python-version }} @@ -37,11 +28,13 @@ jobs: uses: PyO3/maturin-action@v1 with: target: x86_64 + sccache: true args: -i python --release --out dist --sdist --manifest-path cramjam-cli/Cargo.toml - name: Build wheels - x86_64 - cramjam-python uses: PyO3/maturin-action@v1 with: target: x86_64 + sccache: true args: -i python --release --out dist --sdist --manifest-path cramjam-python/Cargo.toml - name: Install built wheels - x86_64 run: | @@ -51,11 +44,13 @@ jobs: if: ${{ matrix.python-version >= '3.8' || contains(fromJson('["3.10", "3.11", "3.12"]'), matrix.python-version) }} uses: PyO3/maturin-action@v1 with: + sccache: true args: -i python --release --target universal2-apple-darwin --out dist --manifest-path cramjam-cli/Cargo.toml - name: Build wheels - universal2 if: ${{ matrix.python-version >= '3.8' || contains(fromJson('["3.10", "3.11", "3.12"]'), matrix.python-version) }} uses: PyO3/maturin-action@v1 with: + sccache: true args: -i python --release --target universal2-apple-darwin --out dist --manifest-path cramjam-python/Cargo.toml - name: Install built wheels - universal2 if: ${{ matrix.python-version >= '3.8' || contains(fromJson('["3.10", "3.11", "3.12"]'), matrix.python-version) }} @@ -83,15 +78,6 @@ jobs: target: [x64, x86] steps: - uses: actions/checkout@v3 - - uses: actions/cache@v3 - with: - path: | - ~/.cargo/bin/ - ~/.cargo/registry/index/ - ~/.cargo/registry/cache/ - ~/.cargo/git/db/ - target/ - key: ${{ runner.os }}-${{ matrix.target }}-${{ matrix.python-version }}-cargo-${{ hashFiles('**/Cargo.lock') }} - uses: actions/setup-python@v5 with: python-version: ${{ matrix.python-version }} @@ -105,11 +91,13 @@ jobs: uses: PyO3/maturin-action@v1 with: target: ${{ matrix.target }} + sccache: true args: -i python --release --out dist --manifest-path cramjam-python/Cargo.toml - name: Build wheels - cramjam-cli uses: PyO3/maturin-action@v1 with: target: ${{ matrix.target }} + sccache: true args: -i python --release --out dist --manifest-path cramjam-cli/Cargo.toml - name: Install built wheel run: | @@ -135,15 +123,6 @@ jobs: target: [x86_64, i686] steps: - uses: actions/checkout@v3 - - uses: actions/cache@v3 - with: - path: | - ~/.cargo/bin/ - ~/.cargo/registry/index/ - ~/.cargo/registry/cache/ - ~/.cargo/git/db/ - target/ - key: ${{ runner.os }}-${{ matrix.target }}-${{ matrix.python-version }}-cargo-${{ hashFiles('**/Cargo.lock') }} - name: Install Rust toolchain uses: dtolnay/rust-toolchain@stable - name: Tests @@ -158,12 +137,14 @@ jobs: with: target: ${{ matrix.target }} manylinux: auto + sccache: true args: -i ${{ matrix.python-version }} --release --out dist --manifest-path cramjam-python/Cargo.toml - name: Build Wheels - cramjam-cli uses: PyO3/maturin-action@v1 with: target: ${{ matrix.target }} manylinux: auto + sccache: true args: -i ${{ matrix.python-version }} --release --out dist --manifest-path cramjam-cli/Cargo.toml - name: Python UnitTest - cramjam-python if: matrix.target == 'x86_64' @@ -200,25 +181,18 @@ jobs: target: aarch64 steps: - uses: actions/checkout@v3 - - uses: actions/cache@v3 - with: - path: | - ~/.cargo/bin/ - ~/.cargo/registry/index/ - ~/.cargo/registry/cache/ - ~/.cargo/git/db/ - target/ - key: ${{ runner.os }}-${{ matrix.target }}-${{ matrix.python }}-cargo-${{ hashFiles('**/Cargo.lock') }} - name: Build Wheels cramjam-python uses: PyO3/maturin-action@v1 with: target: ${{ matrix.target }} + sccache: true manylinux: auto args: -i ${{ matrix.python }} --release --out dist --manifest-path cramjam-python/Cargo.toml - name: Build Wheels cramjam-cli uses: PyO3/maturin-action@v1 with: target: ${{ matrix.target }} + sccache: true manylinux: auto args: -i ${{ matrix.python }} --release --out dist --manifest-path cramjam-cli/Cargo.toml - uses: uraimo/run-on-arch-action@v2.3.0 @@ -270,15 +244,6 @@ jobs: - pypy-3.10 steps: - uses: actions/checkout@v3 - - uses: actions/cache@v3 - with: - path: | - ~/.cargo/bin/ - ~/.cargo/registry/index/ - ~/.cargo/registry/cache/ - ~/.cargo/git/db/ - target/ - key: ${{ runner.os }}-${{ matrix.python }}-cargo-${{ hashFiles('**/Cargo.lock') }} - uses: actions/setup-python@v5 with: python-version: ${{ matrix.python }} @@ -286,12 +251,14 @@ jobs: uses: PyO3/maturin-action@v1 with: manylinux: auto + sccache: true args: -i ${{ matrix.python }} --release ${{ matrix.platform.flags }} --out dist --manifest-path cramjam-python/Cargo.toml - name: Build Wheels - cramjam-cli if: ${{ matrix.platform.os != 'windows-latest' }} uses: PyO3/maturin-action@v1 with: manylinux: auto + sccache: true args: -i ${{ matrix.python }} --release ${{ matrix.platform.flags }} --out dist --manifest-path cramjam-cli/Cargo.toml - name: cramjam test # TODO: I'm not sure but the actual collection of tests on windows using pypy3.10 takes forever and/or fails