Skip to content

Commit

Permalink
Replace actions-rs with rustup (#198)
Browse files Browse the repository at this point in the history
* Updated dependencies

* Attempt to replace actions-rs with rustup

- actions-rs/toolchain#216 (comment)
- Rustup is now available on default github runners, switch to using it. Consider https://github.com/Swatinem/rust-cache in the future

* Removed some missed actions-rs lines

* Added install of cross

* Updated additional github actions to remove actions-rs

- Updated lock files to trigger github actions

* Moved dockerfile to Ubuntu 22.04

* Rolled back docker update due to missing packages
  • Loading branch information
tkmcmaster authored Feb 27, 2024
1 parent 0c7dbd4 commit 5d1882d
Show file tree
Hide file tree
Showing 10 changed files with 1,136 additions and 1,188 deletions.
2 changes: 1 addition & 1 deletion .github/actions/linux-x86_64-musl/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Modified from https://github.com/emk/rust-musl-builder/blob/a980e27da6c6b629301844637e6139053a49e842/Dockerfile
# Use Ubuntu 18.04 LTS as our base image.
# Use Ubuntu 20.04 LTS as our base image.
FROM ubuntu:20.04

# for libressl
Expand Down
8 changes: 2 additions & 6 deletions .github/workflows/pr-guide.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,8 @@ jobs:
steps:
- uses: actions/checkout@v4
- name: Add Rust toolchain
uses: actions-rs/toolchain@v1
with:
profile: minimal
target: wasm32-unknown-unknown
toolchain: stable
override: true
run: rustup toolchain install stable --profile minimal --no-self-update
- run: rustup target add wasm32-unknown-unknown --toolchain stable
- name: Add Node.js toolchain ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
Expand Down
8 changes: 2 additions & 6 deletions .github/workflows/pr-ppaas.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,8 @@ jobs:
steps:
- uses: actions/checkout@v4
- name: Add Rust toolchain
uses: actions-rs/toolchain@v1
with:
profile: minimal
target: wasm32-unknown-unknown
toolchain: stable
override: true
run: rustup toolchain install stable --profile minimal --no-self-update
- run: rustup target add wasm32-unknown-unknown --toolchain stable
- name: Add Node.js toolchain ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
Expand Down
95 changes: 21 additions & 74 deletions .github/workflows/pr-rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,66 +16,34 @@ jobs:
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
- uses: actions-rs/cargo@v1
with:
command: test
args: --all
- run: rustup toolchain install stable --profile minimal --no-self-update
- run: cargo test --all

fmt:
name: Rustfmt
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
components: rustfmt
- uses: actions-rs/cargo@v1
with:
command: fmt
args: --all -- --check
- run: rustup toolchain install stable --profile minimal --no-self-update
- run: cargo fmt --all -- --check

clippy:
name: Clippy
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
components: clippy
- uses: actions-rs/cargo@v1
with:
command: clippy
args: --all -- -D warnings
- run: rustup toolchain install stable --profile minimal --no-self-update
- run: rustup component add clippy
- run: cargo clippy --all -- -D warnings

deny:
name: Cargo Deny
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
- uses: actions-rs/cargo@v1
with:
command: install
args: cargo-deny
- uses: actions-rs/cargo@v1
with:
command: deny
args: check --hide-inclusion-graph license sources advisories
- run: rustup toolchain install stable --profile minimal --no-self-update
- run: cargo install cargo-deny --locked
- run: cargo deny check --hide-inclusion-graph license sources advisories

build:
name: Build
Expand Down Expand Up @@ -117,38 +85,21 @@ jobs:
sudo apt update
sudo apt install ${{ matrix.linker }}
- run: rustup toolchain install stable --profile minimal --no-self-update
# TODO: Consider https://github.com/Swatinem/rust-cache for caching of dependencies

- name: Build for non-Linux # Windows and MacOS
uses: actions-rs/toolchain@v1
if: matrix.os != 'ubuntu-latest'
with:
profile: minimal
toolchain: stable
override: true
- uses: actions-rs/cargo@v1
if: matrix.os != 'ubuntu-latest'
with:
command: build
args: -q --release
run: cargo build -q --release

# https://github.com/actions-rs/cargo#cross-compilation
- name: Build with cross # ARM builds
uses: actions-rs/toolchain@v1
- run: rustup target add ${{ matrix.target }} --toolchain stable
if: matrix.cross
with:
profile: minimal
toolchain: stable
target: ${{ matrix.target }}
override: true
- uses: actions-rs/cargo@v1
- run: cargo install cross
if: matrix.cross
with:
use-cross: true
command: build
args: -q --release --target ${{ matrix.target }}
# uses: ./.github/actions/linux-x86_64-musl/
# if: matrix.cross
# with:
# args: cross build -q --release --target ${{ matrix.target }}

- name: Build with cross # ARM builds
if: matrix.cross
run: cross build -q --release --target ${{ matrix.target }}

- name: Build for Linux
uses: ./.github/actions/linux-x86_64-musl/
Expand All @@ -169,11 +120,7 @@ jobs:
test-directory: ./lib/${{ matrix.wasm-dirctory }}/tests
steps:
- uses: actions/checkout@v4
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
- run: rustup toolchain install stable --profile minimal --no-self-update

- name: Create the Web Assembly
id: wasm_pack
Expand Down
33 changes: 10 additions & 23 deletions .github/workflows/release-test-server.yml
Original file line number Diff line number Diff line change
Expand Up @@ -104,34 +104,21 @@ jobs:
sudo apt update
sudo apt install ${{ matrix.linker }}
- run: rustup toolchain install stable --profile minimal --no-self-update
# TODO: Consider https://github.com/Swatinem/rust-cache for caching of dependencies

- name: Build for non-Linux # Windows and MacOS
uses: actions-rs/toolchain@v1
if: matrix.os != 'ubuntu-latest'
with:
profile: minimal
toolchain: stable
override: true
- uses: actions-rs/cargo@v1
if: matrix.os != 'ubuntu-latest'
with:
command: build
args: -q --release --bin test-server
run: cargo build -q --release --bin test-server

- run: rustup target add ${{ matrix.target }} --toolchain stable
if: matrix.cross
- run: cargo install cross
if: matrix.cross

# https://github.com/actions-rs/cargo#cross-compilation
- name: Build with cross # ARM builds
uses: actions-rs/toolchain@v1
if: matrix.os == 'ubuntu-latest'
with:
profile: minimal
toolchain: stable
target: ${{ matrix.target }}
override: true
- uses: actions-rs/cargo@v1
if: matrix.os == 'ubuntu-latest'
with:
use-cross: true
command: build
args: -q --release --target ${{ matrix.target }} --bin test-server
run: cross build -q --release --target ${{ matrix.target }} --bin test-server

- name: Compress for Linux/Arm
if: matrix.os == 'ubuntu-latest'
Expand Down
49 changes: 16 additions & 33 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -118,34 +118,21 @@ jobs:
sudo apt update
sudo apt install ${{ matrix.linker }}
- run: rustup toolchain install stable --profile minimal --no-self-update
# TODO: Consider https://github.com/Swatinem/rust-cache for caching of dependencies

- name: Build for non-Linux # Windows and MacOS
uses: actions-rs/toolchain@v1
if: matrix.os != 'ubuntu-latest'
with:
profile: minimal
toolchain: stable
override: true
- uses: actions-rs/cargo@v1
if: matrix.os != 'ubuntu-latest'
with:
command: build
args: -q --release
run: cargo build -q --release

# https://github.com/actions-rs/cargo#cross-compilation
- name: Build with cross # ARM builds
uses: actions-rs/toolchain@v1
- run: rustup target add ${{ matrix.target }} --toolchain stable
if: matrix.cross
with:
profile: minimal
toolchain: stable
target: ${{ matrix.target }}
override: true
- uses: actions-rs/cargo@v1
- run: cargo install cross
if: matrix.cross
with:
use-cross: true
command: build
args: -q --release --target ${{ matrix.target }}

- name: Build with cross # ARM builds
if: matrix.cross
run: cross build -q --release --target ${{ matrix.target }}

- name: Build for Linux
uses: ./.github/actions/linux-x86_64-musl/
Expand Down Expand Up @@ -228,11 +215,9 @@ jobs:
sed "0,/version = \".*\"/s//version = \"$version\"/" Cargo2.toml > Cargo.toml
working-directory: ${{env.working-directory}}

- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
- run: rustup toolchain install stable --profile minimal --no-self-update
- run: rustup target add wasm32-unknown-unknown --toolchain stable

- name: Create the Web Assembly
id: wasm_pack
run: |
Expand Down Expand Up @@ -300,11 +285,9 @@ jobs:
sed "0,/version = \".*\"/s//version = \"$version\"/" Cargo2.toml > Cargo.toml
working-directory: ${{env.working-directory}}

- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
- run: rustup toolchain install stable --profile minimal --no-self-update
- run: rustup target add wasm32-unknown-unknown --toolchain stable

- name: Create the Web Assembly
id: wasm_pack
run: |
Expand Down
8 changes: 2 additions & 6 deletions .github/workflows/update-guide.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,8 @@ jobs:
steps:
- uses: actions/checkout@v4
- name: Add Rust toolchain
uses: actions-rs/toolchain@v1
with:
profile: minimal
target: wasm32-unknown-unknown
toolchain: stable
override: true
run: rustup toolchain install stable --profile minimal --no-self-update
- run: rustup target add wasm32-unknown-unknown --toolchain stable
- name: Add Node.js toolchain
uses: actions/setup-node@v4
with:
Expand Down
Loading

0 comments on commit 5d1882d

Please sign in to comment.