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
12 changes: 8 additions & 4 deletions .github/workflows/common.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,11 @@ jobs:
with:
filters: |
run:
- 'toml-doc/**'
- 'common/**'
- 'Cargo.toml'
- 'Cargo.lock'
- 'rust-toolchain.toml'
- '.github/workflows/common.yaml'
clippy:
name: 📎 clippy
Expand Down Expand Up @@ -93,18 +97,18 @@ jobs:
uses: actions-rust-lang/setup-rust-toolchain@166cdcfd11aee3cb47222f9ddb555ce30ddb9659 # v1.17.0
with:
components: llvm-tools-preview
- name: 📦 Install cargo-llvm-cov
- name: 📦 Install cargo-llvm-cov and cargo-nextest
uses: taiki-e/install-action@5b4d68e2e660441203ab128a23676f1e4faf1532 # v2.86.3
with:
tool: cargo-llvm-cov
tool: cargo-llvm-cov,cargo-nextest
- name: ✅ Run tests with coverage
run: cargo llvm-cov -p common --no-default-features --locked --codecov --output-path coverage.json --ignore-filename-regex 'create\.rs'
run: cargo llvm-cov nextest -p common --no-default-features --locked --fail-under-lines 100 --codecov --output-path coverage.json
- name: 📤 Upload coverage
uses: codecov/codecov-action@fb8b3582c8e4def4969c97caa2f19720cb33a72f # v7.0.0
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: coverage.json
flags: rust
flags: common
all-pass:
name: ✅ common
if: always()
Expand Down
10 changes: 10 additions & 0 deletions .github/workflows/pyproject_fmt_build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,14 @@ on:
push:
branches: ["main"]
paths:
- "toml-doc/**"
- "common/**"
- "toml-fmt-common/**"
- "tox-rules/**"
- "pyproject-fmt/**"
- "Cargo.toml"
- "Cargo.lock"
- "rust-toolchain.toml"
- ".github/workflows/pyproject_fmt_build.yaml"
- ".github/workflows/_build.yaml"
pull_request:
Expand Down Expand Up @@ -41,9 +46,14 @@ jobs:
with:
filters: |
run:
- 'toml-doc/**'
- 'common/**'
- 'toml-fmt-common/**'
- 'tox-rules/**'
- 'pyproject-fmt/**'
- 'Cargo.toml'
- 'Cargo.lock'
- 'rust-toolchain.toml'
- '.github/workflows/pyproject_fmt_build.yaml'
- '.github/workflows/_build.yaml'
build:
Expand Down
13 changes: 9 additions & 4 deletions .github/workflows/pyproject_fmt_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,14 @@ jobs:
with:
filters: |
run:
- 'toml-doc/**'
- 'common/**'
- 'toml-fmt-common/**'
- 'tox-rules/**'
- 'pyproject-fmt/**'
- 'Cargo.toml'
- 'Cargo.lock'
- 'rust-toolchain.toml'
- '.github/workflows/pyproject_fmt_test.yaml'
clippy:
name: 📎 clippy
Expand Down Expand Up @@ -95,18 +100,18 @@ jobs:
uses: actions-rust-lang/setup-rust-toolchain@166cdcfd11aee3cb47222f9ddb555ce30ddb9659 # v1.17.0
with:
components: llvm-tools-preview
- name: 📦 Install cargo-llvm-cov
- name: 📦 Install cargo-llvm-cov and cargo-nextest
uses: taiki-e/install-action@5b4d68e2e660441203ab128a23676f1e4faf1532 # v2.86.3
with:
tool: cargo-llvm-cov
tool: cargo-llvm-cov,cargo-nextest
- name: ✅ Run tests with coverage
run: cargo llvm-cov -p pyproject-fmt --no-default-features --locked --codecov --output-path coverage.json --ignore-filename-regex 'main\.rs'
run: cargo llvm-cov nextest -p pyproject-fmt --no-default-features --locked --fail-under-lines 100 --codecov --output-path coverage.json
- name: 📤 Upload coverage
uses: codecov/codecov-action@fb8b3582c8e4def4969c97caa2f19720cb33a72f # v7.0.0
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: coverage.json
flags: rust
flags: pyproject-fmt
py:
name: 🐍 ${{ matrix.py }} @ ${{ matrix.os }}
needs: changes
Expand Down
123 changes: 123 additions & 0 deletions .github/workflows/toml_doc.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,123 @@
name: 🧪 toml-doc
on:
workflow_dispatch:
push:
branches: ["main"]
pull_request:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
permissions:
contents: read
jobs:
changes:
name: 🔍 changes
runs-on: ubuntu-latest
outputs:
run: ${{ github.event_name != 'pull_request' || steps.filter.outputs.run == 'true' }}
steps:
- name: 📥 Checkout
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- name: 🔍 Check for changes
uses: dorny/paths-filter@ceb8a2b8f2d89434be7ff52d3de7ec3738c5cc9d # v4.0.3
id: filter
with:
filters: |
run:
- 'toml-doc/**'
- 'Cargo.toml'
- 'Cargo.lock'
- 'rust-toolchain.toml'
- '.github/workflows/toml_doc.yaml'
clippy:
name: 📎 clippy
needs: changes
if: needs.changes.outputs.run == 'true'
runs-on: ubuntu-24.04
steps:
- name: 📥 Checkout
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
fetch-depth: 1
persist-credentials: false
- name: 🦀 Setup Rust
uses: actions-rust-lang/setup-rust-toolchain@166cdcfd11aee3cb47222f9ddb555ce30ddb9659 # v1.17.0
with:
components: clippy
- name: 📎 Run Clippy
run: cargo clippy -p toml-doc --locked --all-targets -- -D warnings
fmt:
name: 🎨 fmt
needs: changes
if: needs.changes.outputs.run == 'true'
runs-on: ubuntu-24.04
steps:
- name: 📥 Checkout
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
fetch-depth: 1
persist-credentials: false
- name: 🦀 Setup Rust
uses: actions-rust-lang/setup-rust-toolchain@166cdcfd11aee3cb47222f9ddb555ce30ddb9659 # v1.17.0
with:
components: rustfmt
- name: 🎨 Check formatting
run: cargo fmt -p toml-doc --check
build:
name: 🔨 build
needs: changes
if: needs.changes.outputs.run == 'true'
runs-on: ubuntu-24.04
steps:
- name: 📥 Checkout
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
fetch-depth: 1
persist-credentials: false
- name: 🦀 Setup Rust
uses: actions-rust-lang/setup-rust-toolchain@166cdcfd11aee3cb47222f9ddb555ce30ddb9659 # v1.17.0
- name: 🔨 Build
run: cargo build -p toml-doc --locked
test:
name: ✅ test
needs: changes
if: needs.changes.outputs.run == 'true'
runs-on: ubuntu-24.04
environment: test
steps:
- name: 📥 Checkout
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
fetch-depth: 1
persist-credentials: false
- name: 🦀 Setup Rust
uses: actions-rust-lang/setup-rust-toolchain@166cdcfd11aee3cb47222f9ddb555ce30ddb9659 # v1.17.0
with:
components: llvm-tools-preview
- name: 📦 Install cargo-llvm-cov and cargo-nextest
uses: taiki-e/install-action@5b4d68e2e660441203ab128a23676f1e4faf1532 # v2.86.3
with:
tool: cargo-llvm-cov,cargo-nextest
- name: ✅ Run tests with coverage
run: cargo llvm-cov nextest -p toml-doc --locked --fail-under-lines 100 --codecov --output-path coverage.json
- name: 📤 Upload coverage
uses: codecov/codecov-action@fb8b3582c8e4def4969c97caa2f19720cb33a72f # v7.0.0
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: coverage.json
flags: toml-doc
all-pass:
name: ✅ toml-doc
if: always()
needs: [changes, clippy, fmt, build, test]
runs-on: ubuntu-latest
steps:
- name: Decide whether all jobs passed or were skipped
run: |
if [[ "${{ contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled') }}" == "true" ]]; then
echo "Some jobs failed or were canceled"
exit 1
fi
echo "All jobs passed or were skipped"
10 changes: 10 additions & 0 deletions .github/workflows/tox_toml_fmt_build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,14 @@ on:
push:
branches: ["main"]
paths:
- "toml-doc/**"
- "common/**"
- "toml-fmt-common/**"
- "tox-rules/**"
- "tox-toml-fmt/**"
- "Cargo.toml"
- "Cargo.lock"
- "rust-toolchain.toml"
- ".github/workflows/tox_toml_fmt_build.yaml"
- ".github/workflows/_build.yaml"
pull_request:
Expand Down Expand Up @@ -41,9 +46,14 @@ jobs:
with:
filters: |
run:
- 'toml-doc/**'
- 'common/**'
- 'toml-fmt-common/**'
- 'tox-rules/**'
- 'tox-toml-fmt/**'
- 'Cargo.toml'
- 'Cargo.lock'
- 'rust-toolchain.toml'
- '.github/workflows/tox_toml_fmt_build.yaml'
- '.github/workflows/_build.yaml'
build:
Expand Down
27 changes: 21 additions & 6 deletions .github/workflows/tox_toml_fmt_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,14 @@ jobs:
with:
filters: |
run:
- 'toml-doc/**'
- 'common/**'
- 'toml-fmt-common/**'
- 'tox-rules/**'
- 'tox-toml-fmt/**'
- 'Cargo.toml'
- 'Cargo.lock'
- 'rust-toolchain.toml'
- '.github/workflows/tox_toml_fmt_test.yaml'
clippy:
name: 📎 clippy
Expand All @@ -46,7 +51,7 @@ jobs:
with:
components: clippy
- name: 📎 Run Clippy
run: cargo clippy -p tox-toml-fmt --locked --all-targets -- -D warnings
run: cargo clippy -p tox-toml-fmt -p tox-rules --locked --all-targets -- -D warnings
fmt:
name: 🎨 fmt
needs: changes
Expand All @@ -63,7 +68,7 @@ jobs:
with:
components: rustfmt
- name: 🎨 Check formatting
run: cargo fmt -p tox-toml-fmt --check
run: cargo fmt -p tox-toml-fmt -p tox-rules --check
build:
name: 🔨 build
needs: changes
Expand Down Expand Up @@ -95,18 +100,28 @@ jobs:
uses: actions-rust-lang/setup-rust-toolchain@166cdcfd11aee3cb47222f9ddb555ce30ddb9659 # v1.17.0
with:
components: llvm-tools-preview
- name: 📦 Install cargo-llvm-cov
- name: 📦 Install cargo-llvm-cov and cargo-nextest
uses: taiki-e/install-action@5b4d68e2e660441203ab128a23676f1e4faf1532 # v2.86.3
with:
tool: cargo-llvm-cov
tool: cargo-llvm-cov,cargo-nextest
- name: ✅ Run tests with coverage
run: cargo llvm-cov -p tox-toml-fmt --no-default-features --locked --codecov --output-path coverage.json --ignore-filename-regex 'main\.rs'
run: cargo llvm-cov nextest -p tox-toml-fmt --no-default-features --locked --fail-under-lines 100 --codecov --output-path coverage.json
- name: 📤 Upload coverage
uses: codecov/codecov-action@fb8b3582c8e4def4969c97caa2f19720cb33a72f # v7.0.0
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: coverage.json
flags: rust
flags: tox-toml-fmt
# the tox rules are a crate of their own, so they prove their own coverage rather than leaning
# on the formatter that ships them
- name: ✅ Run the tox rule tests with coverage
run: cargo llvm-cov nextest -p tox-rules --no-default-features --locked --fail-under-lines 100 --codecov --output-path tox-rules.json
- name: 📤 Upload the tox rule coverage
uses: codecov/codecov-action@fb8b3582c8e4def4969c97caa2f19720cb33a72f # v7.0.0
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: tox-rules.json
flags: tox-rules
py:
name: 🐍 ${{ matrix.py }} @ ${{ matrix.os }}
needs: changes
Expand Down
6 changes: 0 additions & 6 deletions .github/workflows/update_dependencies.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -66,12 +66,6 @@ jobs:
persist-credentials: false
- name: 🦀 Setup Rust
uses: actions-rust-lang/setup-rust-toolchain@166cdcfd11aee3cb47222f9ddb555ce30ddb9659 # v1.17.0
- name: ⬆️ Update git dependencies
run: |
TOMBI_TAG=$(gh api repos/tombi-toml/tombi/releases/latest --jq .tag_name)
sed -i "s/tombi-toml\/tombi\", tag = \"v[^\"]*\"/tombi-toml\/tombi\", tag = \"$TOMBI_TAG\"/" Cargo.toml
env:
GH_TOKEN: ${{ github.token }}
- name: ⬆️ Update Cargo.toml dependencies
run: |
cargo install cargo-edit
Expand Down
Loading
Loading