mirror of
https://git.aramjonghu.dev/AramJonghu/rustlings.git
synced 2026-09-09 19:23:29 +02:00
Compare commits
2
Commits
2b8273fd55
...
27abea4b5b
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
27abea4b5b | ||
|
|
8f249751ea |
@@ -1,56 +0,0 @@
|
|||||||
name: Check
|
|
||||||
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
branches: [main]
|
|
||||||
paths-ignore:
|
|
||||||
- website
|
|
||||||
- .github/workflows/website.yml
|
|
||||||
- '*.md'
|
|
||||||
pull_request:
|
|
||||||
branches: [main]
|
|
||||||
paths-ignore:
|
|
||||||
- website
|
|
||||||
- .github/workflows/website.yml
|
|
||||||
- '*.md'
|
|
||||||
|
|
||||||
env:
|
|
||||||
CARGO_TERM_COLOR: always
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
clippy:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v6
|
|
||||||
- name: Clippy
|
|
||||||
run: cargo clippy -- --deny warnings
|
|
||||||
fmt:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v6
|
|
||||||
- name: rustfmt
|
|
||||||
run: cargo fmt --all --check
|
|
||||||
test:
|
|
||||||
runs-on: ${{ matrix.os }}
|
|
||||||
strategy:
|
|
||||||
matrix:
|
|
||||||
os: [ubuntu-latest, windows-latest, macos-latest]
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v6
|
|
||||||
- uses: swatinem/rust-cache@v2
|
|
||||||
- name: cargo test
|
|
||||||
env:
|
|
||||||
RUST_BACKTRACE: 1
|
|
||||||
run: cargo test --workspace
|
|
||||||
dev-check:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v6
|
|
||||||
- uses: swatinem/rust-cache@v2
|
|
||||||
- name: rustlings dev check
|
|
||||||
run: cargo dev check --require-solutions
|
|
||||||
rumdl:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v6
|
|
||||||
- uses: rvben/rumdl@v0
|
|
||||||
@@ -1,50 +0,0 @@
|
|||||||
name: Website
|
|
||||||
|
|
||||||
on:
|
|
||||||
workflow_dispatch:
|
|
||||||
push:
|
|
||||||
branches: [main]
|
|
||||||
paths:
|
|
||||||
- website
|
|
||||||
- .github/workflows/website.yml
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
rumdl:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v6
|
|
||||||
- uses: rvben/rumdl@v0
|
|
||||||
build:
|
|
||||||
needs: rumdl
|
|
||||||
defaults:
|
|
||||||
run:
|
|
||||||
working-directory: website
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v6
|
|
||||||
- name: Install TailwindCSS
|
|
||||||
run: npm install
|
|
||||||
- name: Build CSS
|
|
||||||
run: npx @tailwindcss/cli -m -i input.css -o static/main.css
|
|
||||||
- name: Download Zola
|
|
||||||
run: curl -fsSL https://github.com/getzola/zola/releases/download/v0.22.1/zola-v0.22.1-x86_64-unknown-linux-gnu.tar.gz | tar xz
|
|
||||||
- name: Build site
|
|
||||||
run: ./zola build
|
|
||||||
- name: Upload static files as artifact
|
|
||||||
uses: actions/upload-pages-artifact@v5
|
|
||||||
with:
|
|
||||||
path: website/public/
|
|
||||||
deploy:
|
|
||||||
needs: build
|
|
||||||
# Grant GITHUB_TOKEN the permissions required to make a Pages deployment
|
|
||||||
permissions:
|
|
||||||
pages: write # to deploy to Pages
|
|
||||||
id-token: write # to verify the deployment originates from an appropriate source
|
|
||||||
# Deploy to the github-pages environment
|
|
||||||
environment:
|
|
||||||
name: github-pages
|
|
||||||
url: ${{ steps.deployment.outputs.page_url }}
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- name: Deploy to GitHub Pages
|
|
||||||
uses: actions/deploy-pages@v5
|
|
||||||
@@ -2,7 +2,6 @@
|
|||||||
exclude = [
|
exclude = [
|
||||||
"tests/test_exercises",
|
"tests/test_exercises",
|
||||||
"dev",
|
"dev",
|
||||||
"exercises",
|
|
||||||
]
|
]
|
||||||
|
|
||||||
[workspace.package]
|
[workspace.package]
|
||||||
|
|||||||
@@ -3,6 +3,6 @@ fn main() {
|
|||||||
println!("Spell a number: {number}");
|
println!("Spell a number: {number}");
|
||||||
|
|
||||||
// TODO: Fix the compiler error by changing the line below without renaming the variable.
|
// TODO: Fix the compiler error by changing the line below without renaming the variable.
|
||||||
number = 3;
|
let mut number = 3;
|
||||||
println!("Number plus two is: {}", number + 2);
|
println!("Number plus two is: {}", number + 2);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
// TODO: Change the line below to fix the compiler error.
|
// TODO: Change the line below to fix the compiler error.
|
||||||
const NUMBER = 3;
|
const NUMBER: i32 = 3;
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
println!("Number: {NUMBER}");
|
println!("Number: {NUMBER}");
|
||||||
|
|||||||
@@ -1,4 +1,7 @@
|
|||||||
// TODO: Add some function with the name `call_me` without arguments or a return value.
|
// TODO: Add some function with the name `call_me` without arguments or a return value.
|
||||||
|
fn call_me() {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
call_me(); // Don't change this line
|
call_me(); // Don't change this line
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
// TODO: Add the missing type of the argument `num` after the colon `:`.
|
// TODO: Add the missing type of the argument `num` after the colon `:`.
|
||||||
fn call_me(num:) {
|
fn call_me(num:i32) {
|
||||||
for i in 0..num {
|
for i in 0..num {
|
||||||
println!("Ring! Call number {}", i + 1);
|
println!("Ring! Call number {}", i + 1);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,5 +6,5 @@ fn call_me(num: u8) {
|
|||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
// TODO: Fix the function call.
|
// TODO: Fix the function call.
|
||||||
call_me();
|
call_me(32);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user