Skip to content

Commit

Permalink
Merge #1233
Browse files Browse the repository at this point in the history
1233: Replace unmaintained `actions-rs` with `dtolnay/rust-toolchain` r=messense a=messense



Co-authored-by: messense <[email protected]>
  • Loading branch information
bors[bot] and messense authored Nov 1, 2022
2 parents 1924bcd + e97c322 commit 8d03dfd
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 88 deletions.
22 changes: 6 additions & 16 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,32 +19,22 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions-rs/toolchain@v1
- uses: dtolnay/rust-toolchain@stable
with:
profile: minimal
toolchain: stable
components: rustfmt
override: true
- uses: actions-rs/cargo@v1
with:
command: fmt
args: --all -- --check
- name: cargo fmt
run: cargo fmt --all -- --check

clippy:
name: Clippy
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions-rs/toolchain@v1
- uses: dtolnay/rust-toolchain@stable
with:
profile: minimal
toolchain: stable
components: clippy
override: true
- uses: actions-rs/cargo@v1
with:
command: clippy
args: --tests --all-features -- -D warnings
- name: cargo clippy
run: cargo clippy --tests --all-features -- -D warnings

black:
name: Black
Expand Down
31 changes: 9 additions & 22 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,18 +18,11 @@ jobs:
url: ${{ steps.set_url.outputs.env_url }}
steps:
- uses: actions/checkout@v3
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
- uses: actions-rs/cargo@v1
with:
command: login
args: ${{ secrets.CRATES_IO_TOKEN }}
- uses: actions-rs/cargo@v1
with:
command: publish
- uses: dtolnay/rust-toolchain@stable
- name: cargo login
run: cargo login ${{ secrets.CRATES_IO_TOKEN }}
- name: cargo publish
run: cargo publish
- name: Set environment url
id: set_url
run: |
Expand Down Expand Up @@ -67,12 +60,9 @@ jobs:
steps:
# Largely inspired by https://github.com/starship/starship/blob/35a0a20f5c4fea6a08e1b91ff631b089eef8fc50/.github/workflows/deploy.yml
- uses: actions/checkout@v3
- uses: actions-rs/toolchain@v1
- uses: dtolnay/rust-toolchain@stable
with:
profile: minimal
toolchain: stable
override: true
target: ${{ matrix.target }}
targets: ${{ matrix.target }}

- name: Install musl tools
if: matrix.os == 'ubuntu-latest'
Expand Down Expand Up @@ -214,13 +204,10 @@ jobs:
steps:
- uses: actions/checkout@v3
# powerpc64le-unknown-linux-musl doesn't have official std library release
- uses: actions-rs/toolchain@v1
- uses: dtolnay/rust-toolchain@stable
if: matrix.platform.target == 's390x-unknown-linux-gnu'
with:
profile: minimal
toolchain: stable
override: true
target: ${{ matrix.platform.target }}
targets: ${{ matrix.platform.target }}
- name: Build wheel
run: |
sudo python3 -m pip install -U --pre maturin
Expand Down
75 changes: 25 additions & 50 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
python-version: ${{ steps.generate-matrix.outputs.python-version }}
fail-fast: ${{ steps.generate-matrix.outputs.fail-fast }}
steps:
- uses: actions/setup-node@v2
- uses: actions/setup-node@v3
with:
node-version: 16
- run: npm install js-yaml
Expand Down Expand Up @@ -113,13 +113,10 @@ jobs:
run: pip install cffi
- name: Install python packages
run: pip install virtualenv ziglang~=0.9.0 twine
- uses: actions-rs/toolchain@v1
- uses: dtolnay/rust-toolchain@stable
id: rustup
with:
profile: minimal
toolchain: stable
override: true
target: wasm32-wasi # Additional target
targets: wasm32-wasi # Additional target
- name: Install cargo-nextest
uses: taiki-e/install-action@nextest
- name: Install aarch64-apple-darwin Rust target
Expand Down Expand Up @@ -148,14 +145,14 @@ jobs:
brew install gnu-tar
echo "/usr/local/opt/gnu-tar/libexec/gnubin" >> $GITHUB_PATH
- name: Cache cargo build
uses: Swatinem/rust-cache@v1
uses: Swatinem/rust-cache@v2
with:
key: maturin-${{ runner.os }}
- name: Cache test crates cargo build
uses: actions/cache@v2
uses: actions/cache@v3
with:
path: test-crates/targets
key: test-crates-${{ runner.os }}-${{ steps.rustup.outputs.rustc_hash }}-${{ matrix.python-version }}-${{ hashFiles('test-crates/*/Cargo.lock') }}
key: test-crates-${{ runner.os }}-${{ steps.rustup.outputs.cachekey }}-${{ matrix.python-version }}-${{ hashFiles('test-crates/*/Cargo.lock') }}
- name: Set MATURIN_TEST_PYTHON for PyPy
shell: bash
if: contains(matrix.python-version, 'pypy')
Expand Down Expand Up @@ -233,14 +230,11 @@ jobs:
- uses: actions/setup-node@v3
with:
node-version: ${{ env.NODE_VERSION }}
- uses: actions-rs/toolchain@v1
- uses: dtolnay/rust-toolchain@nightly
with:
profile: minimal
toolchain: nightly
components: rust-src
target: wasm32-unknown-emscripten
override: true
- uses: Swatinem/rust-cache@v1
targets: wasm32-unknown-emscripten
- uses: Swatinem/rust-cache@v2
- run: pip install nox
- name: Setup Pyodide
run: nox -s setup-pyodide
Expand Down Expand Up @@ -269,11 +263,11 @@ jobs:
apk add cargo python3-dev libffi-dev py3-pip curl bash tar zstd
pip3 install cffi virtualenv
- name: Cache cargo build
uses: Swatinem/rust-cache@v1
uses: Swatinem/rust-cache@v2
with:
key: maturin-${{ runner.os }}-alpine
- name: Cache test crates cargo build
uses: actions/cache@v2
uses: actions/cache@v3
with:
path: test-crates/targets
key: test-crates-${{ runner.os }}-alpine-${{ hashFiles('test-crates/*/Cargo.lock') }}
Expand All @@ -298,22 +292,18 @@ jobs:
container: quay.io/pypa/${{ matrix.manylinux }}_x86_64
steps:
- uses: actions/checkout@v3
- uses: actions-rs/toolchain@v1
- uses: dtolnay/rust-toolchain@stable
id: rustup
with:
profile: minimal
toolchain: stable
override: true
# Caching
- name: Cache cargo build
uses: Swatinem/rust-cache@v1
uses: Swatinem/rust-cache@v2
with:
key: maturin-${{ runner.os }}
- name: Cache test crates cargo build
uses: actions/cache@v2
uses: actions/cache@v3
with:
path: test-crates/*/target
key: auditwheel-test-crates-${{ runner.os }}-${{ steps.rustup.outputs.rustc_hash }}-${{ hashFiles('test-crates/*/Cargo.lock') }}
key: auditwheel-test-crates-${{ runner.os }}-${{ steps.rustup.outputs.cachekey }}-${{ hashFiles('test-crates/*/Cargo.lock') }}
- name: Compliant Build
run: tests/manylinux_compliant.sh ${{ matrix.manylinux }}
- name: Incompliant Build
Expand All @@ -340,7 +330,7 @@ jobs:
cache-from: type=gha
cache-to: type=gha,mode=max
- name: Cache test crates cargo build
uses: actions/cache@v2
uses: actions/cache@v3
with:
path: test-crates/*/target
# Dockerfile contains the rustc version
Expand Down Expand Up @@ -383,13 +373,9 @@ jobs:
container: ghcr.io/messense/manylinux2014-cross:aarch64
steps:
- uses: actions/checkout@v3
- uses: actions-rs/toolchain@v1
id: rustup
- uses: dtolnay/rust-toolchain@stable
with:
profile: minimal
toolchain: stable
override: true
target: ${{ matrix.platform.target }}
targets: ${{ matrix.platform.target }}
- name: Build wheels
run: |
set -ex
Expand Down Expand Up @@ -423,16 +409,12 @@ jobs:
- 'setup.py'
- 'MANIFEST.in'
- '.github/workflows/test.yml'
- uses: actions-rs/toolchain@v1
- uses: dtolnay/rust-toolchain@stable
if: steps.changes.outputs.changed == 'true'
with:
profile: minimal
toolchain: stable
override: true
# Caching
- name: Cache cargo build
if: steps.changes.outputs.changed == 'true'
uses: Swatinem/rust-cache@v1
uses: Swatinem/rust-cache@v2
with:
key: maturin-${{ runner.os }}-bootstrap
- uses: actions/setup-python@v4
Expand Down Expand Up @@ -463,14 +445,10 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: '1.61.0'
override: true
- uses: dtolnay/[email protected]
# Caching
- name: Cache cargo build
uses: Swatinem/rust-cache@v1
uses: Swatinem/rust-cache@v2
with:
key: maturin-${{ runner.os }}-msrv
- name: cargo build
Expand All @@ -491,14 +469,11 @@ jobs:
run: |
sudo apt-get update
sudo apt-get install -y ${{ matrix.platform.apt-packages }}
- uses: actions-rs/toolchain@v1
- uses: dtolnay/rust-toolchain@stable
with:
profile: minimal
toolchain: stable
target: ${{ matrix.platform.target }}
override: true
targets: ${{ matrix.platform.target }}
- name: Cache cargo build
uses: Swatinem/rust-cache@v1
uses: Swatinem/rust-cache@v2
- name: cargo check
run: cargo check --target ${{ matrix.platform.target }}

Expand Down

0 comments on commit 8d03dfd

Please sign in to comment.