diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 762d83d..2eb1cca 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -31,7 +31,11 @@ jobs: go-version: '1.22' - name: Build go snippets in readme - run: ./scripts/compile_readme_snippets.sh + run: | + mkdir -p ~/.local/bin/ + wget -O ~/.local/bin/lintdown.sh https://raw.githubusercontent.com/ChillerDragon/lintdown.sh/master/lintdown.sh + chmod +x ~/.local/bin/lintdown.sh + lintdown.sh README.md test: runs-on: ubuntu-latest diff --git a/.github/workflows/shell.yml b/.github/workflows/shell.yml deleted file mode 100644 index 3ba74e2..0000000 --- a/.github/workflows/shell.yml +++ /dev/null @@ -1,27 +0,0 @@ -name: Shell - -on: - push: - branches: [ "master" ] - pull_request: - branches: [ "master" ] - -jobs: - bash: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - - name: Prepare - run: | - sudo apt-get update -y - sudo apt-get install shellcheck - mkdir -p ~/.local/bin/ - wget -O ~/.local/bin/shfmt https://github.com/mvdan/sh/releases/download/v3.8.0/shfmt_v3.8.0_linux_amd64 - chmod +x ~/.local/bin/shfmt - - - name: Shellcheck - run: find . -type f -name '*.sh' -print0 | xargs -0 shellcheck - - name: Shell format (shfmt) - run: find . -type f -name '*.sh' -print0 | xargs -0 shfmt -d - diff --git a/scripts/compile_readme_snippets.sh b/scripts/compile_readme_snippets.sh deleted file mode 100755 index 3a4046d..0000000 --- a/scripts/compile_readme_snippets.sh +++ /dev/null @@ -1,22 +0,0 @@ -#!/bin/bash - -mkdir -p tmp -awk '/^```go$/ {p=1}; p; /^```$/ {p=0;print"--- --- ---"}' README.md | - grep -vE '^```(go)?$' | - csplit \ - -z -s - '/--- --- ---/' \ - '{*}' \ - --suppress-matched \ - -f tmp/readme_snippet_ -b '%02d.go' - -for snippet in ./tmp/readme_snippet_*.go; do - echo "building $snippet ..." - go build -v -o tmp/tmp "$snippet" || exit 1 -done - -for snippet in ./tmp/readme_snippet_*.go; do - echo "checking format $snippet ..." - if ! diff -u <(echo -n) <(gofmt -d "$snippet"); then - exit 1 - fi -done