| 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@de0fac2e4500dabe0009e67214ff5f5447ce83dd |
| with: |
| token: ${{ secrets.GITHUB_TOKEN }} |
| |
| - uses: actions/cache@668228422ae6a00e4ad889ee87cd7109ec5666a7 |
| with: |
| path: ~/.pub-cache |
| key: ${{ runner.os }}-pub-cache-${{ hashFiles('**/pubspec.lock') }} |
| restore-keys: | |
| ${{ runner.os }}-pub-cache- |
| |
| - uses: subosito/flutter-action@1a449444c387b1966244ae4d4f8c696479add0b2 |
| with: |
| channel: main |
| cache: true |
| |
| - 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 }} |
| INPUTS_REPOS_FILE: ${{ inputs.repos_file }} |
| |
| - 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 |
| env: |
| STEPS_FC_OUTPUTS_COMMENT_ID: ${{ steps.fc.outputs.comment-id }} |
| |
| - name: Upload markdown |
| if: success() || failure() |
| uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f |
| with: |
| name: output |
| path: output/ |