Merge pull request #1665 from rust-lang/chore/better-ci

chore: consolidate CI workflows
This commit is contained in:
liv 2023-09-04 15:02:14 +02:00 committed by GitHub
commit ae28d2fa2d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 24 additions and 70 deletions

View File

@ -1,18 +0,0 @@
name: Lint
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: DavidAnson/markdownlint-cli2-action@v9
with:
globs: "exercises/**/*.md"

View File

@ -10,13 +10,28 @@ env:
CARGO_TERM_COLOR: always CARGO_TERM_COLOR: always
jobs: jobs:
build: fmt:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v3
- name: Fetch & maybe update Cargo.lock - uses: dtolnay/rust-toolchain@stable
run: cargo fetch --locked with:
- name: Build components: rustfmt
run: cargo build --verbose - uses: DavidAnson/markdownlint-cli2-action@v9
- name: Run tests with:
run: cargo test --verbose globs: "exercises/**/*.md"
- name: Run cargo fmt
run: |
cargo fmt --all -- --check
test:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macOS-latest]
steps:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@stable
- uses: swatinem/rust-cache@v2
- name: Run cargo test
run: |
cargo test

View File

@ -68,17 +68,7 @@ jobs:
run: | run: |
curl --proto '=https' --tlsv1.2 -LsSf https://github.com/axodotdev/oranda/releases/download/v0.3.1/oranda-installer.sh | sh curl --proto '=https' --tlsv1.2 -LsSf https://github.com/axodotdev/oranda/releases/download/v0.3.1/oranda-installer.sh | sh
oranda build oranda build
- name: Prepare HTML for link checking
# untitaker/hyperlink supports no site prefixes, move entire site into
# a subfolder
run: mkdir /tmp/public/ && cp -R public /tmp/public/oranda
- name: Check HTML for broken internal links
uses: untitaker/hyperlink@0.1.29
with:
args: /tmp/public/ --sources docs/
# Deploy to our gh-pages branch (creating it if it doesn't exist) # Deploy to our gh-pages branch (creating it if it doesn't exist)
# the "public" dir that oranda made above will become the root dir # the "public" dir that oranda made above will become the root dir
# of this branch. # of this branch.
@ -95,4 +85,4 @@ jobs:
# Gotta tell the action where to find oranda's output # Gotta tell the action where to find oranda's output
folder: public folder: public
token: ${{ secrets.GITHUB_TOKEN }} token: ${{ secrets.GITHUB_TOKEN }}
single-commit: true single-commit: true

32
Cargo.lock generated
View File

@ -59,37 +59,6 @@ dependencies = [
"windows-sys 0.48.0", "windows-sys 0.48.0",
] ]
[[package]]
name = "argh"
version = "0.1.12"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7af5ba06967ff7214ce4c7419c7d185be7ecd6cc4965a8f6e1d8ce0398aad219"
dependencies = [
"argh_derive",
"argh_shared",
]
[[package]]
name = "argh_derive"
version = "0.1.12"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "56df0aeedf6b7a2fc67d06db35b09684c3e8da0c95f8f27685cb17e08413d87a"
dependencies = [
"argh_shared",
"proc-macro2",
"quote",
"syn",
]
[[package]]
name = "argh_shared"
version = "0.1.12"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5693f39141bda5760ecc4111ab08da40565d1771038c4a0250f03457ec707531"
dependencies = [
"serde",
]
[[package]] [[package]]
name = "assert_cmd" name = "assert_cmd"
version = "2.0.12" version = "2.0.12"
@ -618,7 +587,6 @@ checksum = "dbb5fb1acd8a1a18b3dd5be62d25485eb770e05afb408a9627d14d451bae12da"
name = "rustlings" name = "rustlings"
version = "5.5.1" version = "5.5.1"
dependencies = [ dependencies = [
"argh",
"assert_cmd", "assert_cmd",
"clap", "clap",
"console", "console",

View File

@ -9,7 +9,6 @@ authors = [
edition = "2021" edition = "2021"
[dependencies] [dependencies]
argh = "0.1"
indicatif = "0.17.6" indicatif = "0.17.6"
console = "0.15" console = "0.15"
notify = "4.0" notify = "4.0"