Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions .github/workflows/auto-format.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,18 +27,35 @@ jobs:
- uses: actions/checkout@v4
with:
ref: ${{ github.head_ref || github.ref_name }}
path: meta_core
# Use PAT to trigger downstream workflows; fallback to GITHUB_TOKEN
token: ${{ secrets.PARENT_REPO_PAT || github.token }}

- name: Create workspace Cargo.toml
run: |
cat > Cargo.toml << 'EOF'
[workspace]
members = ["meta_core"]
resolver = "2"

[workspace.package]
version = "0.1.0"
edition = "2021"
license = "MIT"
repository = "https://github.com/harmony-labs/meta"
EOF

- uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt

- name: Run cargo fmt
working-directory: meta_core
run: cargo fmt --all

- name: Check for changes
id: changes
working-directory: meta_core
run: |
if git diff --quiet; then
echo "formatted=false" >> $GITHUB_OUTPUT
Expand All @@ -48,6 +65,7 @@ jobs:

- name: Commit and push
if: steps.changes.outputs.formatted == 'true'
working-directory: meta_core
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
Expand Down
56 changes: 56 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,34 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v6
with:
path: meta_core

- name: Create workspace Cargo.toml
shell: bash
run: |
cat > Cargo.toml << 'EOF'
[workspace]
members = ["meta_core"]
resolver = "2"

[workspace.package]
version = "0.1.0"
edition = "2021"
license = "MIT"
repository = "https://github.com/harmony-labs/meta"
EOF

- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable

- name: Cache Rust
uses: Swatinem/rust-cache@v2
with:
workspaces: meta_core

- name: Run tests
working-directory: meta_core
run: cargo test --all-features

clippy:
Expand All @@ -36,6 +56,22 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v6
with:
path: meta_core

- name: Create workspace Cargo.toml
run: |
cat > Cargo.toml << 'EOF'
[workspace]
members = ["meta_core"]
resolver = "2"

[workspace.package]
version = "0.1.0"
edition = "2021"
license = "MIT"
repository = "https://github.com/harmony-labs/meta"
EOF

- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
Expand All @@ -44,8 +80,11 @@ jobs:

- name: Cache Rust
uses: Swatinem/rust-cache@v2
with:
workspaces: meta_core

- name: Run clippy
working-directory: meta_core
run: cargo clippy --all-targets --all-features -- -D warnings

format:
Expand All @@ -54,11 +93,28 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v6
with:
path: meta_core

- name: Create workspace Cargo.toml
run: |
cat > Cargo.toml << 'EOF'
[workspace]
members = ["meta_core"]
resolver = "2"

[workspace.package]
version = "0.1.0"
edition = "2021"
license = "MIT"
repository = "https://github.com/harmony-labs/meta"
EOF

- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt

- name: Check formatting
working-directory: meta_core
run: cargo fmt --all -- --check
1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ anyhow = "1.0"
dirs = "5"
serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0"
serde_yaml_ng = "0.10"
chrono = { version = "0.4", features = ["serde"] }

[target.'cfg(unix)'.dependencies]
Expand Down
Loading