Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#444 Switch to 'stable' rust toolchain channel #463

Merged
merged 15 commits into from
May 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 43 additions & 0 deletions .github/actions/shared/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: 'Shared action'
runs:
using: "composite"
steps:
- name: Freeing up more disk space
run: |
sudo swapoff -a
sudo rm -f /mnt/swapfile
free -h
docker rmi $(docker image ls -aq)
sudo rm -rf /usr/local/lib/android # will release about 10 GB if you don't need Android
sudo rm -rf /usr/share/dotnet # will release about 20GB if you don't need .NET
sudo rm -rf /opt/ghc
sudo rm -rf /usr/local/share/boost
sudo rm -rf /opt/hostedtoolcache
sudo rm -rf "$AGENT_TOOLSDIRECTORY"
sudo apt-get remove -y 'php.*' --fix-missing
sudo apt-get remove -y '^mongodb-.*' --fix-missing
sudo apt-get remove -y '^mysql-.*' --fix-missing
sudo apt-get remove -y azure-cli google-chrome-stable firefox powershell mono-devel libgl1-mesa-dri --fix-missing
sudo apt-get remove -y google-cloud-sdk --fix-missing
sudo apt-get remove -y google-cloud-cli --fix-missing
sudo apt-get autoremove -y
sudo apt-get clean
df -h
shell: bash

- name: Install package
run: |
echo 'APT::Get::Always-Include-Phased-Updates "false";' | sudo tee /etc/apt/apt.conf.d/99-phased-updates
sudo apt-get update && sudo apt-get upgrade -y
sudo apt-get install -y protobuf-compiler libprotobuf-dev
shell: bash

# Steps taken from https://github.com/actions/cache/blob/master/examples.md#rust---cargo
- name: Cache cargo registry
uses: actions/cache@v4
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }}
78 changes: 35 additions & 43 deletions .github/workflows/test-code.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,50 +9,12 @@ on:
- main

jobs:
test-code:
build-check:
runs-on: ubuntu-latest

steps:
- name: Freeing up more disk space
run: |
sudo swapoff -a
sudo rm -f /mnt/swapfile
free -h
docker rmi $(docker image ls -aq)
sudo rm -rf /usr/local/lib/android # will release about 10 GB if you don't need Android
sudo rm -rf /usr/share/dotnet # will release about 20GB if you don't need .NET
sudo rm -rf /opt/ghc
sudo rm -rf /usr/local/share/boost
sudo rm -rf /opt/hostedtoolcache
sudo rm -rf "$AGENT_TOOLSDIRECTORY"
sudo apt-get remove -y 'php.*' --fix-missing
sudo apt-get remove -y '^mongodb-.*' --fix-missing
sudo apt-get remove -y '^mysql-.*' --fix-missing
sudo apt-get remove -y azure-cli google-chrome-stable firefox powershell mono-devel libgl1-mesa-dri --fix-missing
sudo apt-get remove -y google-cloud-sdk --fix-missing
sudo apt-get remove -y google-cloud-cli --fix-missing
sudo apt-get autoremove -y
sudo apt-get clean
df -h

- name: Install package
run: |
echo 'APT::Get::Always-Include-Phased-Updates "false";' | sudo tee /etc/apt/apt.conf.d/99-phased-updates
sudo apt-get update && sudo apt-get upgrade -y
sudo apt-get install -y protobuf-compiler libprotobuf-dev

- name: Checkout Code
uses: actions/checkout@v3

# Steps taken from https://github.com/actions/cache/blob/master/examples.md#rust---cargo
- name: Cache cargo registry
uses: actions/cache@v4
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }}
- uses: actions/checkout@v3
- uses: ./.github/actions/shared

- name: Install toolchain
# Call `rustup show` as a hack so that the toolchain defined in rust-toolchain.toml is installed
Expand All @@ -70,5 +32,35 @@ jobs:
- name: Check Code
run: cargo check

- name: Test Code
run: cargo test
test-code:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: ./.github/actions/shared

- name: Remove rust-toolchain.toml
# To make sure that the nightly version will be used all throughout
run: |
rm /home/runner/work/pendulum/pendulum/rust-toolchain.toml

- name: Setup nightly Rust toolchain
uses: dtolnay/rust-toolchain@nightly
with:
toolchain: nightly-2024-04-18
components: rustfmt, clippy
target: wasm32-unknown-unknown

- name: Setup nightly Rust as default
run: rustup default nightly-2024-04-18

- name: Install Protoc
uses: arduino/setup-protoc@v1
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
b-yap marked this conversation as resolved.
Show resolved Hide resolved

- name: Test
uses: actions-rs/cargo@v1
with:
toolchain: nightly-2024-04-18
command: test
Loading
Loading