|
| 1 | +name: Quality Control |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: |
| 6 | + - main |
| 7 | + - master |
| 8 | + pull_request: |
| 9 | + branches: |
| 10 | + - main |
| 11 | + - master |
| 12 | + |
| 13 | +jobs: |
| 14 | + protobuf-check: |
| 15 | + name: Protobuf Linting |
| 16 | + runs-on: ubuntu-latest |
| 17 | + env: |
| 18 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 19 | + steps: |
| 20 | + - uses: actions/checkout@v4 |
| 21 | + - name: Install Protoc |
| 22 | + uses: arduino/setup-protoc@v3 |
| 23 | + with: |
| 24 | + repo-token: ${{ secrets.GITHUB_TOKEN }} |
| 25 | + - uses: dart-lang/setup-dart@v1 |
| 26 | + - name: Activate Dart Protoc |
| 27 | + run: dart pub global activate protoc_plugin |
| 28 | + - name: Validate protobufs |
| 29 | + run: | |
| 30 | + protoc --proto_path=protos --dart_out=grpc:client/lib/generated protos/common/*.proto protos/api/*.proto protos/db/*.proto |
| 31 | +
|
| 32 | + rust-check: |
| 33 | + runs-on: ubuntu-latest |
| 34 | + env: |
| 35 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 36 | + steps: |
| 37 | + - uses: actions/checkout@v4 |
| 38 | + - name: Install Protoc |
| 39 | + uses: arduino/setup-protoc@v3 |
| 40 | + with: |
| 41 | + repo-token: ${{ secrets.GITHUB_TOKEN }} |
| 42 | + - uses: actions-rust-lang/setup-rust-toolchain@v1 |
| 43 | + with: |
| 44 | + components: rustfmt, clippy |
| 45 | + - name: Format check |
| 46 | + run: cargo fmt --check |
| 47 | + - name: Clippy |
| 48 | + run: cargo clippy --all-targets -- -D warnings |
| 49 | + |
| 50 | + flutter-check: |
| 51 | + runs-on: ubuntu-latest |
| 52 | + env: |
| 53 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 54 | + steps: |
| 55 | + - uses: actions/checkout@v4 |
| 56 | + - uses: subosito/flutter-action@v2 |
| 57 | + with: |
| 58 | + channel: stable |
| 59 | + - run: flutter --version |
| 60 | + - name: Get dependencies |
| 61 | + working-directory: client |
| 62 | + run: flutter pub get |
| 63 | + - name: Analyze |
| 64 | + working-directory: client |
| 65 | + run: flutter analyze |
| 66 | + |
| 67 | + pre-commit: |
| 68 | + name: Pre-commit Checks |
| 69 | + runs-on: ubuntu-latest |
| 70 | + env: |
| 71 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 72 | + steps: |
| 73 | + - uses: actions/checkout@v4 |
| 74 | + - uses: actions/setup-python@v5 |
| 75 | + with: |
| 76 | + python-version: "3.x" |
| 77 | + - name: Run pre-commit |
| 78 | + uses: pre-commit/action@v3.0.1 |
0 commit comments