mirror of
https://github.com/bahdotsh/wrkflw.git
synced 2026-02-24 03:49:45 +01:00
38 lines
797 B
YAML
38 lines
797 B
YAML
name: Rust Test
|
|
|
|
on:
|
|
push:
|
|
branches: [ main ]
|
|
pull_request:
|
|
|
|
jobs:
|
|
test:
|
|
name: Test Rust
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@v3
|
|
|
|
- name: Setup Rust
|
|
uses: actions-rs/toolchain@v1
|
|
with:
|
|
toolchain: stable
|
|
profile: minimal
|
|
override: true
|
|
|
|
- name: Check Rust version
|
|
run: rustc --version
|
|
|
|
- name: Create simple program
|
|
run: |
|
|
echo 'fn main() {' > hello.rs
|
|
echo ' println!("Hello from Rust!");' >> hello.rs
|
|
echo ' println!("Running on Rust");' >> hello.rs
|
|
echo '}' >> hello.rs
|
|
|
|
- name: Build Rust program
|
|
run: rustc hello.rs -o hello
|
|
|
|
- name: Run Rust program
|
|
run: ./hello |