diff --git a/.github/workflows/pull_request.yml b/.github/workflows/pull_request.yml new file mode 100644 index 0000000..3b41b0f --- /dev/null +++ b/.github/workflows/pull_request.yml @@ -0,0 +1,40 @@ +name: Pull_Request + +on: + pull_request: + +jobs: + lint: + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Set Up Flutter + uses: subosito/flutter-action@v2 + with: + flutter-version: '3.32.1' + channel: 'stable' + + - name: Check Formatting + run: flutter analyze + + test: + runs-on: ubuntu-latest + if: always() + needs: [lint, format] + + steps: + - uses: actions/checkout@v4 + + - name: Set Up Flutter + uses: subosito/flutter-action@v2 + with: + flutter-version: '3.32.1' + channel: 'stable' + + - name: Get dependencies + run: flutter pub get + + - name: Run Tests + run: flutter test \ No newline at end of file diff --git a/.github/workflows/flutter.yml b/.github/workflows/push.yml similarity index 94% rename from .github/workflows/flutter.yml rename to .github/workflows/push.yml index 5bdd4ce..83f87e8 100644 --- a/.github/workflows/flutter.yml +++ b/.github/workflows/push.yml @@ -1,15 +1,13 @@ -name: Flutter +name: Push on: push: branches: - "develop" - "main" - pull_request: jobs: generate_licenses: - if: github.event_name == 'push' && github.ref == 'refs/heads/develop' runs-on: ubuntu-latest steps: @@ -69,7 +67,7 @@ jobs: format: runs-on: ubuntu-latest needs: lint - if: ${{ failure() && needs.lint.result == 'failure' && github.event_name == 'push' && github.ref == 'refs/heads/develop'}} + if: ${{ failure() && needs.lint.result == 'failure'}} steps: - uses: actions/checkout@v4