Skip to content

Commit

Permalink
build(rs): automate Rust releases (#632)
Browse files Browse the repository at this point in the history
  • Loading branch information
DennisInSky authored Nov 7, 2024
1 parent f9cc87d commit 4b80fc1
Show file tree
Hide file tree
Showing 9 changed files with 441 additions and 156 deletions.
22 changes: 22 additions & 0 deletions .github/actions/free-disk-space/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: Free Disk Space
description: Preconfigured action to free up disk space on GitHub Actions runners
# Inputs might be added in the future, but for now, the defaults should be sufficient

runs:
using: composite

steps:
- name: Free Disk Space
uses: jlumbroso/free-disk-space@main
with:
# this might remove tools that are actually needed,
# if set to "true" but frees about 6 GB
tool-cache: false
# all of these default to true, but feel free to set to
# "false" if necessary for your workflow
android: true
dotnet: false
haskell: true
large-packages: false
docker-images: true
swap-storage: true
18 changes: 18 additions & 0 deletions .github/actions/install-wasm-utils/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: Install WASM Utils from Binaryen
description: Install wasm-opt and other utilities from Binaryen
inputs:
binaryen_version:
description: "Binaryen Version"
required: false
default: "111"

runs:
using: composite

steps:
- name: Install wasm-opt
shell: bash
run: |
BINARYEN_VERSION=version_${{ inputs.binaryen_version }}
sudo wget -c https://github.com/WebAssembly/binaryen/releases/download/$BINARYEN_VERSION/binaryen-$BINARYEN_VERSION-x86_64-linux.tar.gz -O - | sudo tar -xz -C .
sudo cp binaryen-$BINARYEN_VERSION/bin/wasm-opt /usr/bin/
154 changes: 0 additions & 154 deletions .github/workflows/ci.yml

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: CI (.Net)
name: '[net] CI (.Net)'

on:
push:
Expand All @@ -17,6 +17,7 @@ on:

jobs:
check:
name: Check Code
runs-on: ubuntu-latest
defaults:
run:
Expand Down
64 changes: 64 additions & 0 deletions .github/workflows/rs-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
name: '[rs] CI (Rust)'

on:
push:
branches: [master]
paths:
- '.cargo/**'
- '.github/workflows/rs-*.yml' # No biggie to trigger this on changes in rs-release.yml
- 'examples/**'
- 'rs/**'
- 'templates/**'
- 'Cargo.lock'
- 'Cargo.toml'
- 'rust-toolchain.toml'
pull_request:
paths:
- '.cargo/**'
- '.github/workflows/rs-*.yml' # No biggie to trigger this on changes in rs-release.yml
- 'examples/**'
- 'rs/**'
- 'templates/**'
- 'Cargo.lock'
- 'Cargo.toml'
- 'rust-toolchain.toml'

env:
CARGO_TERM_COLOR: always

jobs:
check:
name: Check Code
runs-on: ubuntu-latest

steps:
- name: Checkout Code
uses: actions/checkout@v4

- name: Free Disk Space
uses: ./.github/actions/free-disk-space

- name: Install wasm-opt
uses: ./.github/actions/install-wasm-utils

- name: Check Code Formatting
run: |
__GEAR_WASM_BUILDER_NO_FEATURES_TRACKING=1 cargo fmt --all --check
- name: Check Code With Clippy
run: |
__GEAR_WASM_BUILDER_NO_FEATURES_TRACKING=1 cargo clippy --workspace --all-targets --locked -- -D warnings
- name: Check IDL Parser For WASM With Clippy
run: |
__GEAR_WASM_BUILDER_NO_FEATURES_TRACKING=1 cargo clippy -p sails-idl-parser --all-targets --locked --target=wasm32-unknown-unknown -- -D warnings
test:
name: Run Workflow Tests
uses: ./.github/workflows/rs-run-ws-tests.yml
with:
gear_node_version: 1.6.0

test-cli:
name: Run CLI Tests
uses: ./.github/workflows/rs-run-cli-tests.yml
Loading

0 comments on commit 4b80fc1

Please sign in to comment.