diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml new file mode 100644 index 0000000..9dd71db --- /dev/null +++ b/.github/workflows/ci.yaml @@ -0,0 +1,27 @@ +name: CI + +on: + push: + branches: ["main"] + pull_request: + branches: ["main"] + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + - uses: dart-lang/setup-dart@v1.6.5 + + - name: Get Dependencies + run: dart pub get + + - name: Analyze + run: dart analyze . + + - name: Check Format + run: dart format . --output=none --set-exit-if-changed + + - name: Run tests + run: dart test --reporter expanded diff --git a/.github/workflows/commitlint.yaml b/.github/workflows/commitlint.yaml new file mode 100644 index 0000000..66f1299 --- /dev/null +++ b/.github/workflows/commitlint.yaml @@ -0,0 +1,22 @@ +name: Validate commit conventions + +on: + pull_request: + branches: ["main"] + types: [opened, synchronize] + +jobs: + validate: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - uses: dart-lang/setup-dart@v1.6.5 + + - name: Get Dependencies + run: dart pub get + + - name: Validate PR Commits + run: VERBOSE=true dart run commitlint_cli --from=${{ github.event.pull_request.head.sha }}~${{ github.event.pull_request.commits }} --to=${{ github.event.pull_request.head.sha }} --config lib/commitlint.yaml diff --git a/commitlint.yaml b/commitlint.yaml index 0305f52..1612be4 100644 --- a/commitlint.yaml +++ b/commitlint.yaml @@ -9,6 +9,7 @@ rules: - 2 - 'always' - [ + 'ci', 'feat', 'fix', 'docs',