diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index c17036a017..b781b16c7a 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -25,7 +25,6 @@ jobs: ref: ${{ github.event.pull_request.head.ref }} fetch-depth: 0 submodules: recursive - token: ${{ secrets.JENKINS_GITHUB_PAT }} - name: 'Install Nix' uses: cachix/install-nix-action@v25 @@ -40,28 +39,15 @@ jobs: uses: cachix/cachix-action@v17 with: name: k-framework - authToken: '${{ secrets.CACHIX_PUBLIC_TOKEN }}' - name: Format run: nix develop .#style --command bash -c './scripts/fourmolu.sh' - - name: Update branch - env: - GITHUB_EVENT_NAME: ${{ github.event_name }} + - name: Check formatting run: | - if git status -s -b | grep -q '^##.*(no branch)$'; then - echo 2>&1 "Error: Git is in detached HEAD state" - exit 1 - fi - if [ -n "$(git status --porcelain '*.hs')" ]; then - git config --global user.name github-actions - git config --global user.email github-actions@github.com - git add '*.hs' - git commit -m "Format with fourmolu" - git show --stat - git push - echo "Reformatted code pushed, aborting this workflow" | tee -a $GITHUB_STEP_SUMMARY + echo "Code is not formatted. Run scripts/fourmolu.sh and commit the result." | tee -a $GITHUB_STEP_SUMMARY + git diff --stat exit 1 fi # could run hlint here, but then no more jobs would run if the code is not accepted @@ -110,7 +96,6 @@ jobs: uses: cachix/cachix-action@v17 with: name: k-framework - authToken: '${{ secrets.CACHIX_PUBLIC_TOKEN }}' - name: Build run: GC_DONT_GC=1 nix build .#kore-exec .#kore-rpc-booster @@ -258,7 +243,6 @@ jobs: uses: cachix/cachix-action@v17 with: name: k-framework - authToken: '${{ secrets.CACHIX_PUBLIC_TOKEN }}' - name: Format run: nix develop .#style --command bash -c './scripts/hlint.sh'