diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml index e07af23d..86a0d0b3 100644 --- a/.github/workflows/workflow.yml +++ b/.github/workflows/workflow.yml @@ -40,6 +40,10 @@ jobs: steps: - name: Checkout repository uses: actions/checkout@v2 + - name: Setup Dprint + run: curl -fsSL https://dprint.dev/install.sh | sh + - name: Format code + run: npm run fmt - name: Build lowlighter/metrics:${{ github.head_ref || 'master' }} run: docker build -t lowlighter/metrics:$(echo ${{ github.head_ref || 'master' }} | sed 's/\//-/g') . - name: Run tests @@ -61,11 +65,29 @@ jobs: - name: Analyze code uses: github/codeql-action/analyze@v1 + # Format code + format: + name: Format code + runs-on: ubuntu-latest + needs: [ build, analyze ] + steps: + - name: Checkout repository + uses: actions/checkout@v2 + - name: Setup Dprint + run: curl -fsSL https://dprint.dev/install.sh | sh + - name: Format code + run: npm run fmt + - name: Publish formatted code + run: git status + # run: | + # git add --update + # git push + # Update plugins and template indexes, along with README.md update-indexes: name: Publish rebuilt metrics indexes runs-on: ubuntu-latest - needs: [ build, analyze ] + needs: [ build, analyze, format ] if: github.event_name == 'push' && github.ref == 'refs/heads/master' steps: - name: Checkout repository