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
5 changes: 4 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,10 @@ jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4

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

- name: Prevent file change
uses: xalvarez/prevent-file-change-action@v1
Expand Down
62 changes: 62 additions & 0 deletions .github/workflows/pr-check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
name: PR Check

on:
pull_request:
branches: [master]
paths:
- "data/tools/**.yml"
- "ci/**"
workflow_dispatch:
inputs:
pr_number:
description: "PR number to check"
required: true
tool_files:
description: "Space-separated list of tool YAML files to check (e.g. data/tools/foo.yml)"
required: true

jobs:
pr-check:
runs-on: ubuntu-latest
permissions:
pull-requests: write
contents: read
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Get changed tool files
id: changed
run: |
if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then
FILES="${{ inputs.tool_files }}"
else
FILES=$(git diff --name-only --diff-filter=A origin/master...HEAD -- 'data/tools/*.yml' | tr '\n' ' ')
fi
echo "files=$FILES" >> "$GITHUB_OUTPUT"

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

- name: Cache cargo registry
uses: actions/cache@v4
with:
path: |
~/.cargo/registry
~/.cargo/git
ci/target
key: pr-check-${{ runner.os }}-${{ hashFiles('ci/Cargo.lock') }}
restore-keys: |
pr-check-${{ runner.os }}-

- name: Build pr-check
run: cargo build --release --manifest-path ci/Cargo.toml -p pr-check

- name: Run pr-check
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_REPOSITORY: ${{ github.repository }}
PR_NUMBER: ${{ github.event_name == 'workflow_dispatch' && inputs.pr_number || github.event.pull_request.number }}
run: |
ci/target/release/pr-check ${{ steps.changed.outputs.files }}
11 changes: 7 additions & 4 deletions .github/workflows/render.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,20 +7,23 @@ on:
jobs:
build:
runs-on: ubuntu-latest

permissions:
# Give the default GITHUB_TOKEN write permission to commit and push the
# added or changed files to the repository.
contents: write

steps:
- uses: actions/checkout@v3

- uses: actions/checkout@v4

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

- name: Render list
run: make render
env:
GITHUB_TOKEN: ${{ github.token }}

- uses: stefanzweifel/git-auto-commit-action@v4.1.2
with:
commit_message: Commit list
Expand Down
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
logcli-linux-amd64
logcli.zip
logcli.zip
ci/target/
ci/pr-check/target/
14 changes: 7 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -16,23 +16,23 @@ help:

# Main rendering targets
render:
cargo run --manifest-path data/render/Cargo.toml -- --tags data/tags.yml --tools data/tools --md-out README.md --json-out data/api
cargo run --manifest-path ci/Cargo.toml -p render -- --tags data/tags.yml --tools data/tools --md-out README.md --json-out data/api

render-skip-deprecated:
cargo run --manifest-path data/render/Cargo.toml -- --tags data/tags.yml --tools data/tools --md-out README.md --json-out data/api --skip-deprecated
cargo run --manifest-path ci/Cargo.toml -p render -- --tags data/tags.yml --tools data/tools --md-out README.md --json-out data/api --skip-deprecated

# Development targets
check:
cargo check --manifest-path data/render/Cargo.toml
cargo check --manifest-path ci/Cargo.toml

clippy:
cargo clippy --manifest-path data/render/Cargo.toml -- -D warnings
cargo clippy --manifest-path ci/Cargo.toml -- -D warnings

fmt:
cargo fmt --manifest-path data/render/Cargo.toml
cargo fmt --manifest-path ci/Cargo.toml

test:
cargo test --manifest-path data/render/Cargo.toml
cargo test --manifest-path ci/Cargo.toml

clean:
cargo clean --manifest-path data/render/Cargo.toml
cargo clean --manifest-path ci/Cargo.toml
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<!-- 🚨🚨 DON'T EDIT THIS FILE DIRECTLY. Edit `data/tools.yml` instead. 🚨🚨 -->
<!-- 🚨🚨 DON'T EDIT THIS FILE DIRECTLY. Add a file to `data/tools/` instead. 🚨🚨 -->

<a href="https://analysis-tools.dev/">
<img alt="Analysis Tools Website" src="https://raw.githubusercontent.com/analysis-tools-dev/assets/master/static/redesign.svg" />
Expand Down
Loading
Loading