Skip to content

Commit bc47960

Browse files
Merge pull request #1 from logdash-io/dev
first release
2 parents 3b4c8ee + 082b566 commit bc47960

21 files changed

Lines changed: 1985 additions & 0 deletions

.github/workflows/after-pub.yml

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
name: Check deployed package
2+
3+
on:
4+
workflow_dispatch:
5+
workflow_run:
6+
workflows: ["Release-plz"]
7+
types:
8+
- completed
9+
branches:
10+
- main
11+
12+
env:
13+
CARGO_TERM_COLOR: always
14+
CARGO_INCREMENTAL: 0
15+
16+
jobs:
17+
run-after-pub:
18+
name: Run LogDash after publish check
19+
runs-on: ubuntu-latest
20+
if: ${{ github.event.workflow_run.conclusion == 'success' }}
21+
steps:
22+
- uses: actions/checkout@v4
23+
- name: Install Rust Stable
24+
uses: dtolnay/rust-toolchain@stable
25+
- uses: Swatinem/rust-cache@v2
26+
- name: Wait for crates.io to update
27+
run: sleep 60
28+
- name: Create temp project and test
29+
env:
30+
LOGDASH_API_KEY: ${{ secrets.LOGDASH_API_KEY }}
31+
run: |
32+
cargo new temp-test
33+
cd temp-test
34+
cargo add logdash
35+
echo 'fn main() { rs   18:39
36+
// Create a new Logdash client with default configuration
37+
let (l, m) = logdash::create_logdash(logdash::Config::default());
38+
39+
// Send an info log message
40+
l.info("Rust SDK example");
41+
42+
// Send a metric message
43+
m.set("user".into(), 0.0);
44+
45+
// Sleep for 10 seconds to allow the log message to be sent
46+
// This is just for demonstration purposes
47+
// In a real application, you would not want to sleep the thread like this
48+
std::thread::sleep(std::time::Duration::from_secs(10));
49+
}' > src/main.rs
50+
cargo run
51+
cargo test

.github/workflows/audit.yml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: Security Audit
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
paths:
8+
- "**/Cargo.toml"
9+
schedule:
10+
- cron: "0 2 * * *" # run at 2 AM UTC
11+
12+
permissions:
13+
contents: read
14+
15+
jobs:
16+
cargo-deny:
17+
permissions:
18+
checks: write
19+
contents: read
20+
issues: write
21+
runs-on: ubuntu-latest
22+
steps:
23+
- uses: actions/checkout@v4
24+
- uses: EmbarkStudios/cargo-deny-action@v2

.github/workflows/ci.yml

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
pull_request:
6+
7+
env:
8+
CARGO_TERM_COLOR: always
9+
CARGO_INCREMENTAL: 0
10+
11+
permissions:
12+
contents: read
13+
14+
jobs:
15+
build-all:
16+
name: build all toolchain and OS
17+
runs-on: ${{ matrix.os }}
18+
strategy:
19+
matrix:
20+
os: ["ubuntu-latest", "macos-latest", "windows-latest"]
21+
steps:
22+
- uses: actions/checkout@v4
23+
- name: "install Rust Stable"
24+
uses: dtolnay/rust-toolchain@stable
25+
- uses: Swatinem/rust-cache@v2
26+
- name: build
27+
run: cargo build
28+
- name: test
29+
run: cargo test
30+
31+
fmt:
32+
name: fmt
33+
runs-on: ubuntu-latest
34+
steps:
35+
- uses: actions/checkout@v4
36+
- name: Install Rust Stable
37+
uses: dtolnay/rust-toolchain@stable
38+
with:
39+
components: rustfmt
40+
- uses: Swatinem/rust-cache@v2
41+
# Check fmt
42+
- name: "cargo fmt"
43+
run: cargo fmt --all -- --check
44+
45+
clippy:
46+
name: clippy
47+
runs-on: ubuntu-latest
48+
steps:
49+
- uses: actions/checkout@v4
50+
- name: Install Rust Stable
51+
uses: dtolnay/rust-toolchain@stable
52+
with:
53+
components: clippy
54+
- uses: Swatinem/rust-cache@v2
55+
# Run clippy
56+
- name: "clippy --all"
57+
run: cargo clippy --all --tests --no-deps

.github/workflows/release-plz.yml

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
name: Release-plz
2+
3+
permissions:
4+
pull-requests: write
5+
contents: write
6+
7+
on:
8+
push:
9+
branches:
10+
- main
11+
12+
jobs:
13+
# Release unpublished packages.
14+
release-plz-release:
15+
name: Release-plz release
16+
runs-on: ubuntu-latest
17+
permissions:
18+
contents: write
19+
steps:
20+
- name: Checkout repository
21+
uses: actions/checkout@v4
22+
with:
23+
fetch-depth: 0
24+
- name: Install Rust toolchain
25+
uses: dtolnay/rust-toolchain@stable
26+
- name: Run release-plz
27+
uses: release-plz/action@v0.5
28+
with:
29+
command: release
30+
env:
31+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
32+
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
33+
34+
# Create a PR with the new versions and changelog, preparing the next release.
35+
release-plz-pr:
36+
name: Release-plz PR
37+
runs-on: ubuntu-latest
38+
permissions:
39+
contents: write
40+
pull-requests: write
41+
concurrency:
42+
group: release-plz-${{ github.ref }}
43+
cancel-in-progress: false
44+
steps:
45+
- name: Checkout repository
46+
uses: actions/checkout@v4
47+
with:
48+
fetch-depth: 0
49+
- name: Install Rust toolchain
50+
uses: dtolnay/rust-toolchain@stable
51+
- name: Run release-plz
52+
uses: release-plz/action@v0.5
53+
with:
54+
command: release-pr
55+
config: release-plz.toml
56+
env:
57+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
58+
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/target

0 commit comments

Comments
 (0)