Skip to content

Commit

Permalink
Removed Nix packages
Browse files Browse the repository at this point in the history
Signed-off-by: Duc Tri Nguyen <[email protected]>
  • Loading branch information
cothan committed Mar 27, 2024
1 parent b6c3e9e commit 04807b5
Showing 1 changed file with 16 additions and 38 deletions.
54 changes: 16 additions & 38 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
- 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

0 comments on commit 04807b5

Please sign in to comment.