diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index b89c72a6b..eb90c18e6 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -8,41 +8,19 @@ jobs: build_test: runs-on: ubuntu-latest steps: - - name: install jq - shell: bash - run: | - if ! (command -v jq) &> /dev/null - then - sudo apt install -y --no-install-recommends jq - fi - - uses: actions/checkout@v4 - - id: nixpkgs - shell: bash - run: | - if [ -f flake.lock ]; then - nixpkgs="flake:$(cat flake.lock | jq -r '.nodes.nixpkgs.locked // empty | .type + ":" + .owner + "/" + .repo + "/" + .rev')" - else - nixpkgs=channel:nixos-unstable - fi - echo "nixpkgs=$nixpkgs" >> "$GITHUB_OUTPUT" - - uses: cachix/install-nix-action@v25 - with: - nix_path: nixpkgs=${{ steps.nixpkgs.outputs.nixpkgs }} - - name: Prepare nix dev shell - shell: nix develop .#ci -c bash -e {0} - run: | - astyle --version - - name: Astyle - shell: nix develop .#ci -c bash -e {0} - run: | - err=$(astyle $(git ls-files "*.c" "*.h") --options=.astylerc --dry-run --formatted) - if [[ ${#err} != 0 ]]; then - echo "$err" | awk '{split($0,a);print a[2]}' | while IFS= read -r file; do - echo "::error file={"$file"},title={checking}::Formatted $file" - done - exit 1 - fi - - name: Build targets - shell: nix develop .#ci -c bash -e {0} - run: | - make \ No newline at end of file + - uses: actions/checkout@v3 + - name: install dependencies + run: apt-get update && apt install -y astyle jq git + + - name: Astyle version + run: astyle --version + + - name: Astyle test + run: | + err=$(astyle $(git ls-files "*.c" "*.h") --options=.astylerc --dry-run --formatted) + if [[ ${#err} != 0 ]]; then + echo "$err" | awk '{split($0,a);print a[2]}' | while IFS= read -r file; do + echo "::error file={"$file"},title={checking}::Formatted $file" + done + exit 1 + fi \ No newline at end of file