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

Update to use actions-rust-lang/setup-rust-toolchain #76

Merged
merged 1 commit into from
Nov 10, 2024
Merged
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
70 changes: 20 additions & 50 deletions .github/workflows/test-main-lib.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,20 @@ name: Test main lib (Rust crate)
on:
push:
branches:
- main
# paths:
# - 'src/**'
# - 'Cargo.toml'
# - 'tests/**'
- main
paths:
- 'src/**'
- 'Cargo.toml'
- 'tests/**'
- '.github/workflows/test-main-lib.yml'
pull_request:
branches:
- main
- main
paths:
- 'src/**'
- 'tests/**'
- 'Cargo.toml'
- 'src/**'
- 'tests/**'
- 'Cargo.toml'
- '.github/workflows/test-main-lib.yml'

jobs:
test:
Expand All @@ -22,50 +24,18 @@ jobs:
strategy:
fail-fast: false
matrix:
os: [macos-latest, ubuntu-latest, windows-latest, self-hosted]
os: [macos-latest, ubuntu-latest, windows-latest]
bitness: [64] # 32, 64
include:
- os: windows-latest
bitness: 32
- os: windows-latest
bitness: 32

steps:
- name: Checkout source code
uses: actions/checkout@master

- name: Setup Rust toolchain - non-win32
uses: actions-rs/toolchain@v1
with:
override: true
profile: minimal
toolchain: stable
if: ${{ !startsWith(matrix.os, 'windows') || matrix.bitness != '32' }}

- name: Setup Rust toolchain - win32
uses: actions-rs/toolchain@v1
with:
override: true
profile: minimal
toolchain: stable
target: i686-pc-windows-msvc
if: startsWith(matrix.os, 'windows') && matrix.bitness == '32'

- name: Setup Rust dependencies
uses: ATiltedTree/setup-rust@v1
with:
rust-version: 1.65.0
- name: Checkout source code
uses: actions/checkout@v4

- name: Cache Rust files
uses: actions/cache@v2
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ matrix.os }}-${{ matrix.bitness }}-cargo-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
${{ matrix.os }}-${{ matrix.bitness }}-cargo-
- name: Setup Rust toolchain
uses: actions-rust-lang/setup-rust-toolchain@v1

- name: Test
run: cargo test
- name: Test
run: cargo test
Loading