Skip to content

Commit cb8a74f

Browse files
Merge pull request #17 from saverioscagnoli/revert
Revert, Keep only rust project
2 parents 64a5f79 + a8cb29a commit cb8a74f

180 files changed

Lines changed: 463 additions & 5589 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/auto-publish.yml

Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
name:
2+
Auto Publish
3+
4+
# Ensure version in Cargo.toml is bumped before merging to master
5+
6+
on:
7+
push:
8+
branches:
9+
- master
10+
paths:
11+
- "Cargo.toml"
12+
- "src/**"
13+
- "README.md"
14+
- "LICENSE"
15+
16+
env:
17+
CARGO_TERM_COLOR: always
18+
19+
jobs:
20+
check-version:
21+
name: Check if version changed
22+
runs-on: ubuntu-latest
23+
outputs:
24+
version_changed: ${{ steps.check.outputs.changed }}
25+
new_version: ${{ steps.check.outputs.version }}
26+
steps:
27+
- uses: actions/checkout@v4
28+
with:
29+
fetch-depth: 2
30+
31+
- name: Check if version changed
32+
id: check
33+
run: |
34+
CURRENT_VERSION=$(grep '^version' Cargo.toml | head -1 | sed 's/version = "\(.*\)"/\1/')
35+
echo "version=$CURRENT_VERSION" >> $GITHUB_OUTPUT
36+
37+
git diff HEAD^ HEAD -- Cargo.toml | grep -q '^+version' && echo "changed=true" >> $GITHUB_OUTPUT || echo "changed=false" >> $GITHUB_OUTPUT
38+
39+
publish:
40+
name: Publish to crates.io
41+
needs: check-version
42+
if: needs.check-version.outputs.version_changed == 'true'
43+
runs-on: ubuntu-latest
44+
steps:
45+
- uses: actions/checkout@v4
46+
47+
- name: Install Rust
48+
uses: dtolnay/rust-toolchain@stable
49+
50+
- name: Cache cargo registry
51+
uses: actions/cache@v4
52+
with:
53+
path: ~/.cargo/registry
54+
key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }}
55+
56+
- name: Cache cargo index
57+
uses: actions/cache@v4
58+
with:
59+
path: ~/.cargo/git
60+
key: ${{ runner.os }}-cargo-index-${{ hashFiles('**/Cargo.lock') }}
61+
62+
- name: Run tests
63+
run: cargo test --all-features --verbose
64+
65+
- name: Run clippy
66+
run: cargo clippy --all-features -- -D warnings
67+
68+
- name: Check documentation
69+
run: cargo doc --all-features --no-deps
70+
env:
71+
RUSTDOCFLAGS: -D warnings
72+
73+
- name: Dry run publish
74+
run: cargo publish --dry-run --allow-dirty
75+
76+
- name: Publish to crates.io
77+
run: cargo publish --token ${{ secrets.CARGO_REGISTRY_TOKEN }}
78+
env:
79+
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
80+
81+
- name: Create git tag
82+
run: |
83+
VERSION=${{ needs.check-version.outputs.new_version }}
84+
git config user.name "github-actions[bot]"
85+
git config user.email "github-actions[bot]@users.noreply.github.com"
86+
git tag -a "v$VERSION" -m "Release v$VERSION"
87+
git push origin "v$VERSION"

.github/workflows/ci.yml

Lines changed: 103 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,103 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [ master, main, develop ]
6+
pull_request:
7+
branches: [ master, main ]
8+
9+
env:
10+
CARGO_TERM_COLOR: always
11+
RUST_BACKTRACE: 1
12+
13+
jobs:
14+
test:
15+
name: Test
16+
runs-on: ${{ matrix.os }}
17+
strategy:
18+
matrix:
19+
os: [ubuntu-latest, windows-latest, macos-latest]
20+
rust: [stable, beta, nightly]
21+
steps:
22+
- uses: actions/checkout@v4
23+
24+
- name: Install Rust
25+
uses: dtolnay/rust-toolchain@master
26+
with:
27+
toolchain: ${{ matrix.rust }}
28+
29+
- name: Cache cargo registry
30+
uses: actions/cache@v4
31+
with:
32+
path: ~/.cargo/registry
33+
key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }}
34+
35+
- name: Cache cargo index
36+
uses: actions/cache@v4
37+
with:
38+
path: ~/.cargo/git
39+
key: ${{ runner.os }}-cargo-index-${{ hashFiles('**/Cargo.lock') }}
40+
41+
- name: Cache cargo build
42+
uses: actions/cache@v4
43+
with:
44+
path: target
45+
key: ${{ runner.os }}-cargo-build-target-${{ hashFiles('**/Cargo.lock') }}
46+
47+
- name: Run tests (default features)
48+
run: cargo test --verbose
49+
50+
- name: Run tests (all features)
51+
run: cargo test --all-features --verbose
52+
53+
- name: Run tests (no default features)
54+
run: cargo test --no-default-features --verbose
55+
56+
- name: Run tests (blocking feature)
57+
run: cargo test --features blocking --verbose
58+
59+
- name: Run tests (clap feature)
60+
run: cargo test --features clap --verbose
61+
62+
lint:
63+
name: Lint
64+
runs-on: ubuntu-latest
65+
steps:
66+
- uses: actions/checkout@v4
67+
68+
- name: Install Rust
69+
uses: dtolnay/rust-toolchain@stable
70+
with:
71+
components: rustfmt, clippy
72+
73+
- name: Check formatting
74+
run: cargo fmt --all -- --check
75+
76+
- name: Run clippy
77+
run: cargo clippy --all-features -- -D warnings
78+
79+
doc:
80+
name: Documentation
81+
runs-on: ubuntu-latest
82+
steps:
83+
- uses: actions/checkout@v4
84+
85+
- name: Install Rust
86+
uses: dtolnay/rust-toolchain@stable
87+
88+
- name: Check documentation
89+
run: cargo doc --all-features --no-deps --document-private-items
90+
env:
91+
RUSTDOCFLAGS: -D warnings
92+
93+
examples:
94+
name: Examples
95+
runs-on: ubuntu-latest
96+
steps:
97+
- uses: actions/checkout@v4
98+
99+
- name: Install Rust
100+
uses: dtolnay/rust-toolchain@stable
101+
102+
- name: Build all examples
103+
run: cargo build --examples --all-features

.vscode/extensions.json

Lines changed: 0 additions & 3 deletions
This file was deleted.

.vscode/settings.json

Lines changed: 0 additions & 7 deletions
This file was deleted.
File renamed without changes.

rust/Cargo.lock renamed to Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

rust/Cargo.toml renamed to Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "traccia"
3-
version = "2.2.5"
3+
version = "2.2.6"
44
edition = "2024"
55
authors = ["Saverio Scagnoli <svscagn@gmail.com>"]
66
description = "A zero-dependency, flexible logging framework for Rust applications"

0 commit comments

Comments
 (0)