| name: Canary |
| |
| on: |
| workflow_call: |
| inputs: |
| repos_file: |
| description: 'Path to the file containing the list of repository names' |
| type: string |
| required: true |
| local_debug: |
| description: Whether to use a local version of ecosystem testing - only for debug |
| default: false |
| type: boolean |
| required: false |
| |
| jobs: |
| test: |
| runs-on: ubuntu-latest |
| steps: |
| - name: Checkout repository |
| uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 |
| with: |
| token: ${{ secrets.GITHUB_TOKEN }} |
| |
| - uses: subosito/flutter-action@fd55f4c5af5b953cc57a2be44cb082c8f6635e8e |
| with: |
| channel: main |
| |
| - run: echo "${{ toJSON(github.event.pull_request.labels.*.name) }}" |
| |
| - name: Install local version of `package:canary` |
| run: dart pub global activate -s path pkgs/canary |
| if: ${{ inputs.local_debug }} |
| |
| - run: dart pub global activate -s git https://github.com/dart-lang/ecosystem.git --git-ref main --git-path pkgs/canary |
| if: ${{ !inputs.local_debug }} |
| |
| - name: Update package and test |
| run: | |
| dart pub global run canary ${{ inputs.repos_file }} ${{ github.repositoryUrl }} ${{ github.head_ref || github.ref_name }} "${{ toJSON(github.event.pull_request.labels.*.name) }}" |
| env: |
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| |
| - name: Output issue number |
| run: | |
| mkdir -p output |
| echo ${{ github.event.number }} > output/issueNumber |
| |
| - name: Find Comment |
| uses: peter-evans/find-comment@b30e6a3c0ed37e7c023ccd3f1db5c6c0b0c23aad |
| id: fc |
| with: |
| issue-number: ${{ github.event.number }} |
| comment-author: github-actions[bot] |
| body-includes: '## Ecosystem testing' |
| |
| - name: Write comment id to file |
| if: ${{ steps.fc.outputs.comment-id != 0 }} |
| run: echo ${{ steps.fc.outputs.comment-id }} >> output/commentId |
| |
| - name: Upload markdown |
| if: success() || failure() |
| uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 |
| with: |
| name: output |
| path: output/ |