diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..d2d5f0f --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,42 @@ +name: CI + +on: + push: + branches: [main] + pull_request: + branches: [main] + +permissions: + contents: read + +concurrency: + group: ${{ github.workflow }}-${{ github.event_name }}-${{ github.event.pull_request.number || github.run_id }} + cancel-in-progress: ${{ github.event_name == 'pull_request' }} + +jobs: + format: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v7.0.1 + + - uses: oven-sh/setup-bun@v2.2.0 + with: + bun-version-file: package.json + + - name: Install dependencies + run: bun install --frozen-lockfile + + - name: Check formatting + run: bun run format:check + + greenlight: + if: always() + needs: [format] + runs-on: ubuntu-latest + + steps: + - name: Require all checks to succeed + env: + JOB_RESULTS: ${{ toJSON(needs) }} + run: jq --exit-status 'length > 0 and all(.[]; .result == "success")' <<< "$JOB_RESULTS"