Compare commits

..

1 commit
main ... v0.2.1

Author SHA1 Message Date
17584cba0f Version set to 0.2.1
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
ci/woodpecker/tag/woodpecker Pipeline was successful
2024-02-28 17:20:03 +00:00
5 changed files with 81 additions and 87 deletions

View file

@ -1,52 +0,0 @@
name: Rust
on:
push:
branches: ["next"]
pull_request:
branches: ["main"]
env:
CARGO_TERM_COLOR: always
jobs:
build:
runs-on: docker
strategy:
matrix:
toolchain:
- name: stable
- name: nightly
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Format
uses: https://git.kemitix.net/kemitix/rust@v2.3.0
with:
args: ${{ matrix.toolchain.name }} cargo fmt --all -- --check
# - name: Machete
# uses: https://github.com/bnjbvr/cargo-machete@v0.6.2
- name: Clippy
uses: https://git.kemitix.net/kemitix/rust@v2.3.0
with:
args: ${{ matrix.toolchain.name }} cargo clippy
- name: Build
uses: https://git.kemitix.net/kemitix/rust@v2.3.0
with:
args: ${{ matrix.toolchain.name }} cargo build
- name: Test
uses: https://git.kemitix.net/kemitix/rust@v2.3.0
with:
args: ${{ matrix.toolchain.name }} cargo test --no-fail-fast
- name: Integration
uses: https://git.kemitix.net/kemitix/rust@v2.3.0
with:
args: ./test.sh

View file

@ -1,5 +1,5 @@
variables: variables:
- &rust_image "docker.io/rust:1.82.0" - &rust_image "docker.io/rust:1.76"
- &slow_check_paths - &slow_check_paths
- path: - path:
# rust source code # rust source code
@ -14,11 +14,22 @@ variables:
- ".woodpecker.yml" - ".woodpecker.yml"
steps: steps:
toml_fmt: toml_fmt:
image: docker.io/tamasfe/taplo:0.9.3 image: docker.io/tamasfe/taplo:0.8.1
commands: commands:
- taplo format --check - taplo format --check
cargo_fmt:
image: docker.io/rustlang/rust:nightly
environment:
# store cargo data in repo folder so that it gets cached between steps
CARGO_HOME: .cargo_home
commands:
- rustup component add rustfmt
- cargo fmt --check
cargo_machete: cargo_machete:
image: *rust_image image: *rust_image
commands: commands:
@ -36,6 +47,46 @@ steps:
- IGNORED=$(git ls-files --cached -i --exclude-standard) - IGNORED=$(git ls-files --cached -i --exclude-standard)
- if [[ "$IGNORED" ]]; then echo "Ignored files present:\n$IGNORED\n"; exit 1; fi - if [[ "$IGNORED" ]]; then echo "Ignored files present:\n$IGNORED\n"; exit 1; fi
check:
image: *rust_image
environment:
CARGO_HOME: .cargo_home
commands:
- cargo check
when: *slow_check_paths
cargo_clippy:
image: *rust_image
environment:
CARGO_HOME: .cargo_home
commands:
- rustup component add clippy
- cargo clippy --tests --all-targets -- -D warnings
when: *slow_check_paths
cargo_build:
image: *rust_image
environment:
CARGO_HOME: .cargo_home
commands:
- cargo build
- mv target/debug/skip target/skip
when: *slow_check_paths
cargo_test:
image: *rust_image
environment:
RUST_BACKTRACE: "1"
CARGO_HOME: .cargo_home
commands:
- cargo test --no-fail-fast
when: *slow_check_paths
integration_test:
image: *rust_image
commands:
- ./test.sh
publish_to_crates_io: publish_to_crates_io:
image: *rust_image image: *rust_image
commands: commands:

View file

@ -2,7 +2,7 @@
Skip part of a file. Skip part of a file.
As `head` will show the top of a file up-to a number of line, As `head` will show the top of a file after a number of line,
so `skip` will do the opposite, and not show the top of the file, so `skip` will do the opposite, and not show the top of the file,
but will show the rest. but will show the rest.

View file

@ -1,10 +1,6 @@
{ {
"$schema": "https://docs.renovatebot.com/renovate-schema.json", "$schema": "https://docs.renovatebot.com/renovate-schema.json",
"extends": ["config:recommended"], "extends": [
"packageRules": [ "config:recommended"
{
"matchManagers": ["cargo"],
"rangeStrategy": "replace"
}
] ]
} }

View file

@ -5,7 +5,7 @@ set -e
echo "PWD: $PWD" echo "PWD: $PWD"
ls -l ls -l
ls -l target ls -l target
SKIP="./target/debug/skip" SKIP="./target/skip"
DIFF="diff -u --color" DIFF="diff -u --color"
if test ! -x $SKIP ; then if test ! -x $SKIP ; then
@ -14,8 +14,7 @@ if test ! -x $SKIP; then
fi fi
echo "> skip a line when reading from stdin" echo "> skip a line when reading from stdin"
INPUT=$( INPUT=$(cat<<EOF
cat <<EOF
line 1 line 1
line 2 line 2
EOF EOF