Skip to content

Commit

Permalink
Merge branch 'main' into refactor-FloatContent-interface
Browse files Browse the repository at this point in the history
  • Loading branch information
cartercanedy authored Oct 9, 2024
2 parents 34152c0 + 79eb752 commit f287771
Show file tree
Hide file tree
Showing 38 changed files with 667 additions and 299 deletions.
2 changes: 2 additions & 0 deletions .cargo/config.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[alias]
xtask = "run --package xtask --"
4 changes: 2 additions & 2 deletions .github/mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ nav:
- Introduction: 'index.md'
- User Guide: 'userguide.md'
- Contributing:
- Contributing Guide: 'contribute.md'
- Contributing Guide: 'contributing.md'
- Roadmap: 'roadmap.md'
- Documentation:
- Known Issues: 'KnownIssues.md'
Expand Down Expand Up @@ -86,4 +86,4 @@ plugins:
minify_html: true
htmlmin_opts:
remove_comments: true
cache_safe: true
cache_safe: true
11 changes: 11 additions & 0 deletions .github/workflows/github-pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,17 @@ jobs:
with:
fetch-depth: '0' # Fetch all commit history for all branches as well as tags.

- name: Copy Contributing Guidelines
run: |
echo "<!-- THIS FILE IS GENERATED AUTOMATICALLY. EDIT .github/CONTRIBUTING.md -->\n\n$(cat .github/CONTRIBUTING.md)" > 'docs/contributing.md'
- uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: Commit Contributing Guidelines
file_pattern: "docs/contributing.md"
add_options: '--force'
if: success()

- name: Setup Python
uses: actions/setup-python@v5
with:
Expand Down
21 changes: 11 additions & 10 deletions .github/workflows/linutil.yml
Original file line number Diff line number Diff line change
Expand Up @@ -89,22 +89,23 @@ jobs:
version: ${{ env.version }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Install vhs
- name: Setup Preview
run: |
wget 'https://github.com/charmbracelet/vhs/releases/download/v0.8.0/vhs_0.8.0_amd64.deb'
sudo apt install -y ffmpeg
sudo snap install ttyd --classic
sudo dpkg -i 'vhs_0.8.0_amd64.deb'
echo "$(pwd)/build" >> $GITHUB_PATH
- name: Generate preview
uses: charmbracelet/[email protected]
with:
path: "docs/assets/preview.tape"

- name: Build the preview
- name: Move preview
run: |
export PATH="$(pwd)/build:$PATH"
vhs docs/assets/preview.tape -o docs/assets/preview.gif
mv preview.gif docs/assets/preview.gif
- name: Upload the preview
- name: Upload preview
uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: Preview for ${{ env.version }}
file_pattern: "docs/assets/preview.gif"
add_options: "--force"
if: success()
if: success()
45 changes: 35 additions & 10 deletions .github/workflows/shellcheck.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,42 @@ jobs:
- uses: actions/checkout@v4
- run: git fetch origin ${{ github.base_ref }}

- name: Download and set up shellcheck
- name: Download, setup, and run ShellCheck
shell: bash {0}
run : |
wget https://github.com/koalaman/shellcheck/releases/download/v0.10.0/shellcheck-v0.10.0.linux.x86_64.tar.xz
tar -xf shellcheck-v0.10.0.linux.x86_64.tar.xz
cd shellcheck-v0.10.0
chmod +x shellcheck
- name: Run shellcheck
run: |
for file in $(git diff --name-only origin/${{ github.base_ref }} HEAD core/tabs); do
SC_URL="https://github.com/koalaman/shellcheck/releases/download/v0.10.0/shellcheck-v0.10.0.linux.x86_64.tar.xz"
curl -fsSL "$SC_URL" | tar -Jx
chmod +x "./shellcheck-v0.10.0/shellcheck"
error=0
files_to_check=$(git diff --name-only origin/${{ github.base_ref }} HEAD core/tabs)
for file in $files_to_check; do
if [[ "$file" == *.sh ]] && [[ -f "$file" ]]; then
./shellcheck-v0.10.0/shellcheck -S error "$file"
sc_output=$(./shellcheck-v0.10.0/shellcheck -fgcc -Serror "$file")
iter_safe_parsed_errors=$(echo -e "$sc_output" | sed -n 's/\(.\+\)\:\([0-9]\+\)\:\([0-9]\+\)\: \(.*\)/::error file=\1,line=\2,col=\3::\4/p' | sed 's/ /:space:/g')
for error in $iter_safe_parsed_errors; do
echo "$error" | sed 's/:space:/ /g'
error=1
done
tabs_detected=$(grep -nP '^\t+\S+' "$file")
# fast fail on the action runner would fail immediately if there weren't any tabs found
# this check makes sure that we don't continue if there's something really weird going on
if [ "$?" = "2" ]; then
echo "::error file=$file::There was a critical error while grepping $file, aborting"
exit 1
fi
iter_safe_parsed_tabs_detected=$(echo "$tabs_detected" | sed -n 's,\([0-9]\+\).*,::error file='"$file"'\,line=\1::Found tab indentations,p' | sed 's/ /:space:/g')
for error in $iter_safe_parsed_tabs_detected; do
echo "$error" | sed 's/:space:/ /g'
error=1
done
fi
done
exit $error
15 changes: 15 additions & 0 deletions .github/workflows/typos.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: Check for typos

on:
[push, pull_request, workflow_dispatch]

jobs:
check-typos:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- run: git fetch origin ${{ github.base_ref }}

- name: Run spellcheck
uses: crate-ci/[email protected]
58 changes: 58 additions & 0 deletions .github/workflows/xtask.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
name: XTasks

on:
pull_request:
paths:
- "xtask"
- "Cargo.toml"
- "Cargo.lock"
- ".cargo"
- "core/tabs"
- "docs"
push:
paths:
- "xtask"
- "Cargo.toml"
- "Cargo.lock"
- ".cargo"
- "core/tabs"
- "docs"

env:
CARGO_TERM_COLOR: always

jobs:
docgen:
name: DocGen
runs-on: ubuntu-latest

steps:
- name: Checkout sources
uses: actions/checkout@v4

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

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

- name: Cache Cargo index
uses: actions/cache@v4
with:
path: ~/.cargo/git
key: ${{ runner.os }}-cargo-index-${{ hashFiles('**/Cargo.lock') }}
restore-keys: ${{ runner.os }}-cargo-index-

- name: Run cargo xtask docgen
run: cargo xtask docgen

- name: Check uncommitted documentation changes
run: |
git diff
git diff-files --quiet \
|| (echo "Run 'cargo xtask docgen' and push the changes" \
&& exit 1)
Loading

0 comments on commit f287771

Please sign in to comment.