Lpa 23 #128
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: CI | |
| on: | |
| pull_request: | |
| types: | |
| - opened | |
| - synchronize | |
| - edited | |
| branches: | |
| - main | |
| permissions: | |
| checks: write | |
| pull-requests: write | |
| jobs: | |
| analyse: | |
| name: Analysis π | |
| runs-on: ubuntu-latest | |
| permissions: write-all | |
| steps: | |
| - name: π Checkout code | |
| uses: actions/checkout@v2 | |
| - name: π Extract flutter version | |
| id: fvmrc | |
| # get flutter key from .fvmrc file (file is in json format) | |
| run: echo "FLUTTER_VERSION=$(jq -r '.flutter' .fvmrc)" >> $GITHUB_OUTPUT | |
| - name: π Set up Flutter | |
| uses: subosito/flutter-action@v1 | |
| with: | |
| flutter-version: ${{ steps.fvmrc.outputs.FLUTTER_VERSION }} | |
| - name: π¦ Get dependencies | |
| run: flutter pub get | |
| - name: π Analyze code | |
| continue-on-error: true | |
| run: flutter analyze --no-pub >> analysis.txt | |
| - name: π Set up Python | |
| uses: actions/setup-python@v4.7.1 | |
| with: | |
| python-version: '3.10' | |
| - name: π Construct analysis comment | |
| run: python .github/workflows/construct_analysis_comment.py analysis.txt ${{ github.event.pull_request.head.sha }} ${{ github.event.number }} comment.txt | |
| - name: π€ Create GitHub App Token | |
| uses: actions/create-github-app-token@v1.11.5 | |
| id: token | |
| with: | |
| app-id: ${{ vars.CI_APP_ID }} | |
| private-key: ${{ secrets.CI_PRIVATE_KEY }} | |
| - name: π¬ Post analysis comment | |
| uses: peter-evans/create-or-update-comment@v3.1.0 | |
| with: | |
| body-path: comment.txt | |
| issue-number: ${{ github.event.pull_request.number }} | |
| token: ${{ steps.token.outputs.token }} | |
| - name: β Annotate analysis results | |
| uses: invertase/github-action-dart-analyzer@v3 | |
| test: | |
| name: Testing π§ͺ | |
| runs-on: ubuntu-latest | |
| permissions: write-all | |
| steps: | |
| - name: π Checkout code | |
| uses: actions/checkout@v2 | |
| - name: π Extract flutter version | |
| id: fvmrc | |
| # get flutter key from .fvmrc file (file is in json format) | |
| run: echo "FLUTTER_VERSION=$(jq -r '.flutter' .fvmrc)" >> $GITHUB_OUTPUT | |
| - name: π Set up Flutter | |
| uses: subosito/flutter-action@v1 | |
| with: | |
| flutter-version: ${{ steps.fvmrc.outputs.FLUTTER_VERSION }} | |
| - name: π Set up Python | |
| uses: actions/setup-python@v4.7.1 | |
| with: | |
| python-version: '3.10' | |
| - name: π¦ Get dependencies | |
| run: flutter pub get | |
| - name: π οΈ Start Moodle mock server | |
| uses: mockoon/cli-action@v1 | |
| with: | |
| data-file: test/mockoon/moodle.json | |
| port: 6000 | |
| - name: π Start public API mock server | |
| uses: mockoon/cli-action@v1 | |
| with: | |
| data-file: test/mockoon/public_api.json | |
| port: 6008 | |
| - name: π§ͺ Start unit tests mock server | |
| uses: mockoon/cli-action@v1 | |
| with: | |
| data-file: test/mockoon/unit_tests.json | |
| port: 3000 | |
| - name: ποΈ Start files mock server | |
| uses: mockoon/cli-action@v1 | |
| with: | |
| data-file: test/mockoon/files.json | |
| port: 5000 | |
| - name: π Run tests | |
| continue-on-error: true | |
| run: flutter test --machine > test-results.json | |
| - name: π€ Create GitHub App Token | |
| uses: actions/create-github-app-token@v1.11.5 | |
| id: token | |
| with: | |
| app-id: ${{ vars.CI_APP_ID }} | |
| private-key: ${{ secrets.CI_PRIVATE_KEY }} | |
| - name: π Annotate test results | |
| uses: dorny/test-reporter@v1.9.1 | |
| id: reporter | |
| with: | |
| name: Test Results | |
| path: test-results.json | |
| reporter: dart-json | |
| token: ${{ steps.token.outputs.token }} | |
| - run: pip install requests | |
| - name: π Construct test comment | |
| run: python .github/workflows/construct_unit_test_comment.py ${{ steps.reporter.outputs.url }} ${{ github.event.pull_request.head.sha }} comment.txt | |
| - name: π¬ Post test comment | |
| uses: peter-evans/create-or-update-comment@v3.1.0 | |
| with: | |
| body-path: comment.txt | |
| issue-number: ${{ github.event.pull_request.number }} | |
| token: ${{ steps.token.outputs.token }} | |
| validate-title: | |
| name: Validate PR title | |
| runs-on: ubuntu-latest | |
| permissions: | |
| pull-requests: read | |
| statuses: write | |
| steps: | |
| - uses: amannn/action-semantic-pull-request@505e44b4f33b4c801f063838b3f053990ee46ea7 # v4.6.0 | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| with: | |
| types: | | |
| build | |
| chore | |
| ci | |
| docs | |
| feat | |
| fix | |
| perf | |
| refactor | |
| revert | |
| style | |
| test | |
| subjectPattern: ^[A-Z].+$ | |
| subjectPatternError: | | |
| The subject of the PR must begin with an uppercase letter. |