Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 24 additions & 8 deletions .github/workflows/pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,12 @@ jobs:
outputs:
env: ${{ steps.get_env.outputs.env }}
steps:
- uses: actions/checkout@v4
- name: Checkout code
uses: actions/checkout@v4
with:
repository: ${{github.event.pull_request.head.repo.full_name}}
ref: ${{ github.head_ref }}

- name: Determine Environment
id: get_env
run: |
Expand All @@ -25,35 +27,49 @@ jobs:
echo PR
echo "env=pr" >> $GITHUB_OUTPUT
fi

pull_request_checks:
needs: set-env
environment: ${{needs.set-env.outputs.env}}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Checkout code
uses: actions/checkout@v4
with:
repository: ${{github.event.pull_request.head.repo.full_name}}
ref: ${{ github.head_ref }}
- uses: subosito/flutter-action@v2

- name: Set up Flutter
uses: subosito/flutter-action@v2
with:
cache: true
- uses: actions/setup-node@v4

- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: "20.x"
- run: npm i
- run: yes | npx @vercel/ncc build src/main.ts
node-version: "20"

- name: Install dependencies
run: yarn install --immutable

- name: Build bundled file
run: yes | npx @vercel/ncc build src/main.ts

- name: setup flutter test repos
run: |
cd tests/fail_repo
flutter pub get
cd ../pass_repo
flutter pub get
cd ../..

- name: run tests
run: npm run test
run: yarn run test

- name: Check for modified files
id: git-check
run: echo "modified=$(if [ -n "$(git status --porcelain)" ]; then echo "true"; else echo "false"; fi)" >> $GITHUB_ENV

- name: Update changes in GitHub repository
if: env.modified == 'true'
run: |
Expand Down
948 changes: 948 additions & 0 deletions .yarn/releases/yarn-4.9.1.cjs

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions .yarnrc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
yarnPath: .yarn/releases/yarn-4.9.1.cjs
nodeLinker: node-modules
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,15 @@ jobs:
| create-comment | Whether the action should comment the output status. | false | true |
| working-directory | Working directory to run the action in | false | "." |
| coverage-pass-score | Coverage passing percentage | false | "90" |
| test-command | Command used to run test suite. | false | "" |

By default, the `test-command` input is empty, and the action uses the following command to run tests and generate coverage:

```bash
flutter test --coverage --reporter json --coverage-path ${coverageDirectory}/lcov.info
```

If you provide a custom `test-command`, this default behavior is overridden. Note that the `${coverageDirectory}/lcov.info` path for coverage output is not automatically applied when using a custom command. You must ensure that your custom test command handles coverage generation and specifies the appropriate output path if required.

## Coverage

Expand Down
5 changes: 5 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,3 +55,8 @@ inputs:
description: "Coverage passing percentage"
required: false
default: "90"

test-command:
description: "Command used to run tests"
required: false
default: ""
112,111 changes: 54,381 additions & 57,730 deletions dist/index.js

Large diffs are not rendered by default.

Loading
Loading