mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-12-25 09:08:38 -07:00
* Shellcheck on build_linux.sh and tiny refactor `shellcheck -e SC1090 build_linux.sh` and fixed the issues. Also fixed the usage command to return an error, simplify directory creation to use `mkdir -p`, and made printing of the cmake commands consistent instead of having three different ways of doing it. * Reorder functions in more pleasing way * Add shellcheck to workflows This is the beginning of adding some safety nets for making changes. Currently it just runs shellcheck against `build_linux.sh`. You can see it working at https://github.com/coryrc/OrcaSlicer/actions/workflows/shellcheck.yml I forked and tested it running in PRs and against pushes to HEAD. * Rerun shellcheck Missed quotes on the merge
38 lines
1 KiB
YAML
38 lines
1 KiB
YAML
on:
|
|
push:
|
|
paths:
|
|
- build_linux.sh
|
|
pull_request:
|
|
paths:
|
|
- build_linux.sh
|
|
workflow_dispatch: # allows for manual dispatch
|
|
|
|
name: "Shellcheck"
|
|
permissions: {}
|
|
|
|
jobs:
|
|
shellcheck:
|
|
name: Shellcheck
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Cache shellcheck download
|
|
id: cache-shellcheck-v0_11
|
|
uses: actions/cache@v4
|
|
with:
|
|
path: ~/shellcheck
|
|
key: ${{ runner.os }}-shellcheck-v0_11
|
|
|
|
- name: Download shellcheck
|
|
if: steps.cache-shellcheck-v0_11.outputs.cache-hit != 'true'
|
|
shell: bash
|
|
env:
|
|
INPUT_VERSION: "v0.11.0"
|
|
run: |
|
|
curl -L#o ~/sc.tar.xz "https://github.com/koalaman/shellcheck/releases/download/${INPUT_VERSION}/shellcheck-${INPUT_VERSION}.linux.x86_64.tar.xz"
|
|
tar -xvf ~/sc.tar.xz -C ~
|
|
mv ~/shellcheck-"${INPUT_VERSION}"/shellcheck ~/shellcheck
|
|
|
|
- uses: actions/checkout@v4
|
|
|
|
- name: Shellcheck build_linux.sh
|
|
run: ~/shellcheck -e SC1090 build_linux.sh
|