Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: remove betamax and upgrade deps #119

Merged
merged 40 commits into from
Nov 8, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
a86c120
chore: fix formatting
onehassan Oct 25, 2023
d5c0951
chore: update melos to `3.2.0` and http to `1.1.0`
onehassan Oct 25, 2023
a557808
chore: remove references to betamax
onehassan Oct 27, 2023
d2b288c
chore: upgrade deps
onehassan Oct 27, 2023
63d3d72
chore: fix tests
onehassan Oct 27, 2023
a314a47
chore: use DotEnv to parse .env file
onehassan Oct 27, 2023
a38809d
chore: add local nhost project for running test
onehassan Oct 30, 2023
0f61711
test: add serverless functions for testing
onehassan Oct 30, 2023
a178be3
chore: configure test to run against local nhost project
onehassan Oct 30, 2023
0c7427b
chore: clear users after running test
onehassan Oct 30, 2023
e3426b0
chore: fix mfa tests
onehassan Oct 31, 2023
af6e2af
chore: fix storage tests
onehassan Oct 31, 2023
b0c7396
chore: remove http fixtures
onehassan Oct 31, 2023
72bb25a
chore: remove old testing project
onehassan Oct 31, 2023
827df46
chore: move testing project under the nhost_dart package
onehassan Oct 31, 2023
081445b
chore: use different test emails for auth and storage tests
onehassan Oct 31, 2023
24959d3
chore: add GITHUB_TOKEN to avoid rate limiting when checking for brok…
onehassan Nov 1, 2023
cf624df
chore: fix links
onehassan Nov 1, 2023
e236a4c
chore: fix ci workflows
onehassan Nov 1, 2023
d4e6f5c
chore: fix formatting
onehassan Nov 1, 2023
3bea317
chore: fix static analysis issues
onehassan Nov 1, 2023
94cf1c1
chore(ci): add steps to install nhost cli and start the test_backend
onehassan Nov 1, 2023
73e9014
chore: fix path to test_backend project
onehassan Nov 1, 2023
a4b4ad5
chore: remove `.secrets` from `.gitignore`
onehassan Nov 1, 2023
cacc519
chore: run tests with `sudo`
onehassan Nov 1, 2023
db6b7ea
chore: run flutter test with `sudo`
onehassan Nov 1, 2023
78bbee8
chore(ci): add step to install sudo package
onehassan Nov 2, 2023
afc7b9d
Revert "chore(ci): add step to install sudo package"
onehassan Nov 2, 2023
78f0694
chore: ci: run flutter test with no `sudo`
onehassan Nov 2, 2023
091d016
chore: ci: run melos using sudo with full path
onehassan Nov 2, 2023
6cf9fd9
chore: ci: make sure dart is present in path when running tests
onehassan Nov 2, 2023
ca1cb8a
chore: ci: comment out storage tests
onehassan Nov 2, 2023
be19f4f
chore: ci: override nhost data-folder path
onehassan Nov 2, 2023
fabe53b
chore: ci: wait 5 before running the tests
onehassan Nov 2, 2023
abbc315
chore: remove sleep command in workflow
onehassan Nov 7, 2023
93a80c7
chore: fix command syntax in test.nhost_dart.yaml
onehassan Nov 7, 2023
94834d4
chore: restore storage_test.dart
onehassan Nov 8, 2023
bd294df
chore: update graphql dependency version
onehassan Nov 8, 2023
c8628fc
fix: typo in GitHub token variable in
onehassan Nov 8, 2023
fbb6981
fix(tests): clear users before running storage test
onehassan Nov 8, 2023
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
2 changes: 2 additions & 0 deletions .github/workflows/check_broken_links.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ jobs:
runs-on: ubuntu-latest
env:
LYCHEE_OUT: tmp/lychee_results.md
GITHUB_TOKEN: ${{ github.token }}
steps:
- uses: actions/checkout@master
- name: Check links
Expand All @@ -26,3 +27,4 @@ jobs:
**/*.md
**/*.yaml
**/*.dart
--github-token $GITHUB_TOKEN
196 changes: 90 additions & 106 deletions .github/workflows/test.nhost_auth_dart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
# Instantiations of this template are produced by the Melos postbootstrap script
# which can be found in `melos.yaml`.

name: 'nhost_auth_dart tests'
name: "nhost_auth_dart tests"
on:
push:
branches:
Expand All @@ -19,122 +19,106 @@ on:
branches:
- main
# schedule:
# Run the quality job at 4am every day
# - cron: '0 4 * * *'
# Run the quality job at 4am every day
# - cron: '0 4 * * *'

env: {}
jobs:
# Ensure that the package meets a suitably high pub.dev score
score-package-quality:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
# We test against several Flutter versions
flutter_channel: [stable, beta]

steps:
- uses: actions/checkout@v2

- run: .github/workflows/scripts/make-pana-pubspecs.sh

- uses: axel-op/dart-package-analyzer@v3
# Set an id for the current step, so we can reference it later
id: analysis
with:
githubToken: ${{ secrets.GITHUB_TOKEN }}
relativePath: packages/nhost_auth_dart

- name: Require analysis (near) perfection
env:
# "analysis" is the id set above
TOTAL: ${{ steps.analysis.outputs.total }}
TOTAL_MAX: ${{ steps.analysis.outputs.total_max }}
run: |
PERCENTAGE=$((( $TOTAL ) * 100 / ( $TOTAL_MAX - ${MAX_PANA_MISSING_POINTS:-10} )))
if (( $PERCENTAGE < 100 ))
then
echo "Score to low ($TOTAL/$TOTAL_MAX)."
exit 1
fi
- uses: actions/checkout@v2

- run: .github/workflows/scripts/make-pana-pubspecs.sh

- uses: axel-op/dart-package-analyzer@v3
# Set an id for the current step, so we can reference it later
id: analysis
with:
githubToken: ${{ github.token }}
relativePath: packages/nhost_auth_dart

- name: Require analysis (near) perfection
env:
# "analysis" is the id set above
TOTAL: ${{ steps.analysis.outputs.total }}
TOTAL_MAX: ${{ steps.analysis.outputs.total_max }}
run: |
PERCENTAGE=$((( $TOTAL ) * 100 / ( $TOTAL_MAX - ${MAX_PANA_MISSING_POINTS:-10} )))
if (( $PERCENTAGE < 100 ))
then
echo "Score to low ($TOTAL/$TOTAL_MAX)."
exit 1
fi

# Analyzes, checks formatting, and tests the packages
test-package:
runs-on: ubuntu-latest

strategy:
fail-fast: false
matrix:
# We test against several Flutter versions
flutter_channel: [stable, beta]

steps:
- uses: actions/checkout@v2

- name: Determine Flutter version
id: flutter-version
uses: shyndman/[email protected]
with:
channel: ${{ matrix.flutter_channel }}

- name: Cache Flutter dependencies
uses: actions/cache@v1
with:
path: /opt/hostedtoolcache/flutter
key: ${{ runner.OS }}-flutter-install-cache-${{ steps.flutter-version.outputs.version }}

# Setup the flutter environment
- name: Setup Dart/Flutter (specific channel)
uses: subosito/[email protected]
with:
channel: ${{ matrix.flutter_channel }}

# Get binary dependencies
- name: Install tools
run: |
echo "$HOME/.pub-cache/bin" >> $GITHUB_PATH
dart pub get
dart pub global activate junitreport
dart pub global activate melos 2.9.0

- name: Bootstrap packages
run: melos bootstrap

# Run analysis on all packages
- name: Analyze packages
run: dart run melos analyze

# Run tests for package in question
- name: Execute tests
run: >
melos exec
--scope=nhost_auth_dart
--dir-exists=test --
'flutter test --no-pub --machine --coverage | tojunit
> test-results.xml'

# Report test results
- name: Report test results
uses: mikepenz/action-junit-report@v2
with:
check_name: 'Test results: nhost_auth_dart'
require_tests: false
report_paths: "packages/nhost_auth_dart/test-results.xml"
github_token: ${{ secrets.GITHUB_TOKEN }}

# Check if coverage was generated
- name: Check for coverage file
id: check_coverage_exists
uses: andstor/file-existence-action@v1
with:
files: "packages/nhost_auth_dart/coverage/lcov.info"

# Report coverage
- name: Report coverage
uses: zgosalvez/github-actions-report-lcov@v1
with:
artifact-name: 'Test coverage for nhost_auth_dart'
coverage-files: packages/nhost_auth_dart/coverage/lcov.info
working-directory: packages/nhost_auth_dart/
github-token: ${{ secrets.GITHUB_TOKEN }}
if: ${{ github.event_name != 'pull_request' && steps.check_coverage_exists.outputs.files_exists == 'true' }}
- uses: actions/checkout@v2

- name: Cache Flutter dependencies
uses: actions/cache@v1
with:
path: /opt/hostedtoolcache/flutter
key: ${{ runner.OS }}-flutter-install-cache-${{ steps.flutter-version.outputs.version }}

# Setup the flutter environment
- name: Setup Dart/Flutter (specific channel)
uses: subosito/flutter-action@v2
with:
flutter-version: "3.13.9"
channel: "stable"

# Get binary dependencies
- name: Install tools
run: |
echo "$HOME/.pub-cache/bin" >> $GITHUB_PATH
dart pub get
dart pub global activate junitreport
dart pub global activate melos 3.2.0

- name: Bootstrap packages
run: melos bootstrap

# Run analysis on all packages
- name: Analyze packages
run: dart run melos analyze

# Run tests for package in question
- name: Execute tests
run: >
melos exec
--scope=nhost_auth_dart
--dir-exists=test --
'flutter test --no-pub --machine --coverage | tojunit
> test-results.xml'

# Report test results
- name: Report test results
uses: mikepenz/action-junit-report@v2
with:
check_name: "Test results: nhost_auth_dart"
require_tests: false
report_paths: "packages/nhost_auth_dart/test-results.xml"
github_token: ${{ github.token }}

# Check if coverage was generated
- name: Check for coverage file
id: check_coverage_exists
uses: andstor/file-existence-action@v1
with:
files: "packages/nhost_auth_dart/coverage/lcov.info"

# Report coverage
- name: Report coverage
uses: zgosalvez/github-actions-report-lcov@v1
with:
artifact-name: "Test coverage for nhost_auth_dart"
coverage-files: packages/nhost_auth_dart/coverage/lcov.info
working-directory: packages/nhost_auth_dart/
github-token: ${{ github.token }}
if: ${{ github.event_name != 'pull_request' && steps.check_coverage_exists.outputs.files_exists == 'true' }}
Loading
Loading