Skip to content

Commit

Permalink
ci test
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions committed Aug 29, 2024
1 parent b499e22 commit a58207b
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 41 deletions.
81 changes: 41 additions & 40 deletions .github/workflows/pull-request.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
name: CI - Pull Request
on:
pull_request_target:
# pull_request_target:
push:

# Pull Request Runs on the same branch will be cancelled
concurrency:
Expand All @@ -14,53 +15,53 @@ jobs:
steps:
- uses: actions/checkout@v4
with:
repository: ${{github.event.pull_request.head.repo.full_name}}
ref: ${{ github.head_ref }}
# repository: ${{github.event.pull_request.head.repo.full_name}}
# ref: ${{ github.head_ref }}
fetch-depth: 0
- uses: subosito/flutter-action@v2
with:
cache: true
- run: dart run build_runner build --delete-conflicting-outputs
- uses: ZebraDevs/flutter-code-quality@main
- uses: ZebraDevs/flutter-code-quality@fix/testFailedComment
with:
token: ${{secrets.GITHUB_TOKEN}}
coverage-pass-score: '1'


check-secret:
runs-on: ubuntu-latest
outputs:
secret-exists: ${{ steps.check.outputs.defined }}
steps:
- name: Check PR can access secrets
id: check
run: |
echo "defined=true" >> $GITHUB_OUTPUT;
if [ "${{ secrets.FIREBASE_SERVICE_ACCOUNT_ZETA_DS }}" == '' ]; then
echo "defined=false" >> $GITHUB_OUTPUT;
fi
# check-secret:
# runs-on: ubuntu-latest
# outputs:
# secret-exists: ${{ steps.check.outputs.defined }}
# steps:
# - name: Check PR can access secrets
# id: check
# run: |
# echo "defined=true" >> $GITHUB_OUTPUT;
# if [ "${{ secrets.FIREBASE_SERVICE_ACCOUNT_ZETA_DS }}" == '' ]; then
# echo "defined=false" >> $GITHUB_OUTPUT;
# fi

deploy-preview:
name: Deploy preview version of the storybook on firebase
needs: [code-quality, check-secret]
if: needs.check-secret.outputs.secret-exists == 'true'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
repository: ${{github.event.pull_request.head.repo.full_name}}
ref: ${{ github.head_ref }}
- uses: subosito/flutter-action@v2
with:
cache: true
- name: Setup flutter
run: flutter pub get
- name: Build example app
run: |
cd example
flutter build web -t widgetbook/main.dart -o ../build --no-tree-shake-icons
- uses: FirebaseExtended/action-hosting-deploy@v0
with:
repoToken: "${{ secrets.GITHUB_TOKEN }}"
firebaseServiceAccount: "${{ secrets.FIREBASE_SERVICE_ACCOUNT_ZETA_DS }}"
channelId: "pr-${{ github.event.number }}-${{ github.event.pull_request.head.ref }}"
# deploy-preview:
# name: Deploy preview version of the storybook on firebase
# needs: [code-quality, check-secret]
# if: needs.check-secret.outputs.secret-exists == 'true'
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v4
# with:
# repository: ${{github.event.pull_request.head.repo.full_name}}
# ref: ${{ github.head_ref }}
# - uses: subosito/flutter-action@v2
# with:
# cache: true
# - name: Setup flutter
# run: flutter pub get
# - name: Build example app
# run: |
# cd example
# flutter build web -t widgetbook/main.dart -o ../build --no-tree-shake-icons
# - uses: FirebaseExtended/action-hosting-deploy@v0
# with:
# repoToken: "${{ secrets.GITHUB_TOKEN }}"
# firebaseServiceAccount: "${{ secrets.FIREBASE_SERVICE_ACCOUNT_ZETA_DS }}"
# channelId: "pr-${{ github.event.number }}-${{ github.event.pull_request.head.ref }}"
2 changes: 1 addition & 1 deletion test/src/theme/color_extensions_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ void main() {
expect(color.onColor, ZetaColorBase.white);

const lightColor = Colors.white;
expect(lightColor.onColor, ZetaColorBase.cool.shade90);
expect(lightColor.onColor, ZetaColorBase.cool.shade40);
});

test('isLight returns true for light colors', () {
Expand Down

0 comments on commit a58207b

Please sign in to comment.