Add new job to pipeline #419
Workflow file for this run
This file contains 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: Test Workflow | |
on: | |
push: | |
branches: [main] | |
pull_request: | |
branches: [main] | |
jobs: | |
test_mix_repo: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout mix repo | |
uses: actions/checkout@v2 | |
with: | |
path: main | |
- name: Checkout remix_ui repo | |
uses: actions/checkout@v2 | |
with: | |
repository: conceptadev/remix_ui | |
path: remix | |
- name: Setup Flutter | |
uses: subosito/flutter-action@v2 | |
with: | |
channel: "stable" | |
- run: cd main && flutter pub get | |
- uses: axel-op/dart-package-analyzer@v3 | |
with: | |
githubToken: ${{ secrets.GITHUB_TOKEN }} | |
relativePath: main | |
- run: cd main && flutter test | |
update_and_analyze_remix_ui: | |
runs-on: ubuntu-latest | |
needs: test_mix_repo | |
steps: | |
- name: Checkout mix repo | |
uses: actions/checkout@v2 | |
with: | |
path: main | |
- name: Checkout remix_ui repo | |
uses: actions/checkout@v2 | |
with: | |
repository: conceptadev/remix_ui | |
path: remix | |
- name: Setup Flutter | |
uses: subosito/flutter-action@v2 | |
with: | |
channel: "stable" | |
- name: Add most recent mix version to remix_ui | |
run: | | |
cd remix | |
dart pub remove mix | |
dart pub add 'mix:{"git":{"url":"https://github.com/conceptadev/mix","ref": ${{ github.head_ref }}}}' | |
- name: Verify if there are any undefined symbols | |
id: undefined_symbols | |
run: | | |
cd remix | |
if flutter analyze lib | grep -q 'undefined'; then | |
echo "A file contains undefined symbols. Please add a deprecated annotation before you remove it." | |
exit 1 | |
fi | |
- name: Add Label to Issue | |
uses: actions/github-script@v7 | |
if: ${{ failure() && steps.undefined_symbols.conclusion == 'failure' }} | |
with: | |
script: | | |
github.rest.issues.addLabels({ | |
issue_number: context.issue.number, | |
owner: context.repo.owner, | |
repo: context.repo.repo, | |
labels: ['New Deprecation'] | |
}) | |
github.rest.issues.createComment({ | |
issue_number: context.issue.number, | |
owner: context.repo.owner, | |
repo: context.repo.repo, | |
body: 'Hello 😊, we have noticed a breaking change in our API. Please add the deprecated annotation before you remove it.' | |
}) | |
test_remix_ui: | |
runs-on: ubuntu-latest | |
continue-on-error: true | |
needs: update_and_analyze_remix_ui | |
if: ${{ needs.update_and_analyze_remix_ui.result == 'success' }} | |
steps: | |
- name: Checkout mix repo | |
uses: actions/checkout@v2 | |
with: | |
path: main | |
- name: Checkout remix_ui repo | |
uses: actions/checkout@v2 | |
with: | |
repository: conceptadev/remix_ui | |
path: remix | |
- name: Setup Flutter | |
uses: subosito/flutter-action@v2 | |
with: | |
channel: "stable" | |
- name: Add most recent mix version to remix_ui | |
run: | | |
cd remix | |
dart pub remove mix | |
dart pub add 'mix:{"git":{"url":"https://github.com/conceptadev/mix","ref":${{ github.head_ref }}}}' | |
- run: cd remix && flutter test | |
id: remix_test | |
- name: Add Label to Issue and Comment | |
uses: actions/github-script@v7 | |
if: ${{ failure() && steps.remix_test.conclusion == 'failure' }} | |
with: | |
script: | | |
github.rest.issues.addLabels({ | |
issue_number: context.issue.number, | |
owner: context.repo.owner, | |
repo: context.repo.repo, | |
labels: ['Behavior Change'] | |
}) | |
github.rest.issues.createComment({ | |
issue_number: context.issue.number, | |
owner: context.repo.owner, | |
repo: context.repo.repo, | |
body: "We have noticed a change in Mix's behavior. Are you sure about this" | |
}) |