2020-11-20 09:01:18 -08:00
|
|
|
name: CI
|
|
|
|
|
2020-11-25 08:57:36 -08:00
|
|
|
on: [push, pull_request]
|
2020-11-20 09:01:18 -08:00
|
|
|
|
|
|
|
env:
|
|
|
|
PUB_ENVIRONMENT: bot.github
|
|
|
|
|
|
|
|
jobs:
|
2021-05-25 10:12:30 -07:00
|
|
|
# Compile the latest sqlite3 library, which will be used to run tests in moor
|
|
|
|
# and sqlparser
|
|
|
|
compile_sqlite3:
|
|
|
|
name: "Compile sqlite3 for tests"
|
|
|
|
runs-on: ubuntu-20.04
|
|
|
|
env:
|
2022-02-23 13:12:34 -08:00
|
|
|
SQLITE_YEAR: "2022"
|
2022-02-23 13:06:42 -08:00
|
|
|
SQLITE_VERSION: "3380000"
|
2021-11-14 03:20:42 -08:00
|
|
|
|
2021-05-25 10:12:30 -07:00
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
- uses: actions/cache@v2
|
|
|
|
id: cache_build
|
|
|
|
with:
|
|
|
|
path: /tmp/sqlite/out/
|
|
|
|
key: ${{ runner.os }}-${{ env.SQLITE_VERSION }}
|
|
|
|
- name: Compile sqlite3
|
|
|
|
if: steps.cache_build.outputs.cache-hit != 'true'
|
|
|
|
run: |
|
|
|
|
cd /tmp/
|
|
|
|
mkdir sqlite
|
|
|
|
cd sqlite
|
2022-02-23 13:12:34 -08:00
|
|
|
curl https://sqlite.org/$SQLITE_YEAR/sqlite-autoconf-$SQLITE_VERSION.tar.gz --output sqlite.tar.gz
|
2021-05-25 10:12:30 -07:00
|
|
|
tar zxvf sqlite.tar.gz
|
|
|
|
cd sqlite-autoconf-$SQLITE_VERSION
|
|
|
|
./configure
|
|
|
|
make
|
|
|
|
mkdir ../out
|
|
|
|
cp sqlite3 ../out
|
|
|
|
cp .libs/libsqlite3.so ../out
|
|
|
|
- name: Upload built sqlite3 binaries
|
|
|
|
uses: actions/upload-artifact@v2
|
|
|
|
with:
|
|
|
|
name: sqlite3
|
|
|
|
path: /tmp/sqlite/out/
|
|
|
|
if-no-files-found: error
|
|
|
|
retention-days: 1
|
|
|
|
|
2022-01-18 13:35:49 -08:00
|
|
|
drift:
|
2021-10-10 13:01:59 -07:00
|
|
|
name: "drift package"
|
2021-05-25 10:12:30 -07:00
|
|
|
needs: [compile_sqlite3]
|
2020-11-20 10:36:03 -08:00
|
|
|
runs-on: ubuntu-20.04
|
2021-05-25 05:24:48 -07:00
|
|
|
defaults:
|
|
|
|
run:
|
2021-10-10 13:01:59 -07:00
|
|
|
working-directory: drift
|
2020-11-20 09:01:18 -08:00
|
|
|
steps:
|
|
|
|
# setup
|
2020-11-20 09:03:42 -08:00
|
|
|
- uses: actions/checkout@v2
|
2021-11-14 03:20:42 -08:00
|
|
|
- uses: dart-lang/setup-dart@v1
|
2021-05-28 13:28:21 -07:00
|
|
|
- name: Download sqlite3
|
|
|
|
uses: actions/download-artifact@v2
|
|
|
|
with:
|
|
|
|
name: sqlite3
|
|
|
|
path: /tmp/sqlite/out/
|
|
|
|
- name: Use downloaded sqlite3
|
2021-05-25 05:24:48 -07:00
|
|
|
run: |
|
2021-05-28 13:28:21 -07:00
|
|
|
chmod a+x /tmp/sqlite/out/sqlite3
|
|
|
|
echo "/tmp/sqlite/out" >> $GITHUB_PATH
|
|
|
|
echo "LD_LIBRARY_PATH=/tmp/sqlite/out" >> $GITHUB_ENV
|
2021-05-25 05:24:48 -07:00
|
|
|
- name: Check sqlite3 version
|
|
|
|
run: sqlite3 --version
|
2020-11-20 09:01:18 -08:00
|
|
|
- run: dart pub upgrade
|
2022-08-14 08:33:10 -07:00
|
|
|
- name: Get dependencies for plugin
|
|
|
|
run: |
|
2022-08-14 08:37:18 -07:00
|
|
|
echo "dependency_overrides:" >> pubspec_overrides.yaml
|
|
|
|
echo " drift: {path: ../../}" >> pubspec_overrides.yaml
|
|
|
|
echo " drift_dev: {path: ../../../drift_dev}" >> pubspec_overrides.yaml
|
|
|
|
echo " sqlparser: {path: ../../../sqlparser}" >> pubspec_overrides.yaml
|
2022-08-14 08:33:10 -07:00
|
|
|
dart pub get
|
2022-08-14 02:28:23 -07:00
|
|
|
working-directory: drift/tools/analyzer_plugin
|
2020-11-20 09:01:18 -08:00
|
|
|
# analysis
|
2021-05-25 05:24:48 -07:00
|
|
|
- run: dart format -o none --set-exit-if-changed .
|
2020-11-20 09:01:18 -08:00
|
|
|
name: dartfmt
|
|
|
|
- run: dart analyze --fatal-infos --fatal-warnings
|
|
|
|
# build, test and upload coverage
|
2020-11-20 09:25:53 -08:00
|
|
|
- run: dart run build_runner build --delete-conflicting-outputs
|
2022-01-18 13:35:49 -08:00
|
|
|
- run: dart test --preset ci_unit_tests #-x background_isolate --coverage=coverage
|
2020-11-20 11:30:21 -08:00
|
|
|
# - uses: actions/upload-artifact@v2
|
|
|
|
# with:
|
|
|
|
# name: moor-coverage-data
|
|
|
|
# path: |
|
|
|
|
# moor/coverage/
|
|
|
|
# moor/.dart_tool/package_config.json
|
|
|
|
# retention-days: 1
|
2020-11-20 09:01:18 -08:00
|
|
|
|
2021-10-10 13:01:59 -07:00
|
|
|
drift_dev:
|
2020-11-20 10:36:03 -08:00
|
|
|
runs-on: ubuntu-20.04
|
2022-04-06 04:00:35 -07:00
|
|
|
timeout-minutes: 10
|
2021-05-25 05:24:48 -07:00
|
|
|
defaults:
|
|
|
|
run:
|
2021-10-10 13:01:59 -07:00
|
|
|
working-directory: drift_dev
|
2020-11-20 09:01:18 -08:00
|
|
|
steps:
|
|
|
|
# setup
|
2020-11-20 09:03:42 -08:00
|
|
|
- uses: actions/checkout@v2
|
2021-11-14 03:20:42 -08:00
|
|
|
- uses: dart-lang/setup-dart@v1
|
2020-11-20 09:01:18 -08:00
|
|
|
- run: dart pub upgrade
|
|
|
|
# analysis
|
2021-05-25 05:24:48 -07:00
|
|
|
- run: dart format -o none --set-exit-if-changed .
|
2020-11-20 09:01:18 -08:00
|
|
|
name: dartfmt
|
|
|
|
- run: dart analyze --fatal-infos --fatal-warnings
|
2022-01-18 13:35:49 -08:00
|
|
|
- run: dart test
|
2021-11-28 11:47:39 -08:00
|
|
|
name: test
|
2020-11-20 09:01:18 -08:00
|
|
|
|
|
|
|
sqlparser:
|
2020-11-20 10:36:03 -08:00
|
|
|
runs-on: ubuntu-20.04
|
2021-05-28 13:28:21 -07:00
|
|
|
needs: [compile_sqlite3]
|
2021-05-25 05:24:48 -07:00
|
|
|
defaults:
|
|
|
|
run:
|
|
|
|
working-directory: sqlparser
|
2020-11-20 09:01:18 -08:00
|
|
|
steps:
|
|
|
|
# setup
|
2020-11-20 09:03:42 -08:00
|
|
|
- uses: actions/checkout@v2
|
2021-11-14 03:20:42 -08:00
|
|
|
- uses: dart-lang/setup-dart@v1
|
2021-05-25 10:12:30 -07:00
|
|
|
- name: Download sqlite3
|
|
|
|
uses: actions/download-artifact@v2
|
|
|
|
with:
|
|
|
|
name: sqlite3
|
|
|
|
path: /tmp/sqlite/out/
|
|
|
|
- name: Use downloaded sqlite3
|
|
|
|
run: |
|
|
|
|
chmod a+x /tmp/sqlite/out/sqlite3
|
|
|
|
echo "/tmp/sqlite/out" >> $GITHUB_PATH
|
|
|
|
echo "LD_LIBRARY_PATH=/tmp/sqlite/out" >> $GITHUB_ENV
|
2020-11-20 09:01:18 -08:00
|
|
|
- run: dart pub upgrade
|
|
|
|
# analysis
|
2021-05-25 05:24:48 -07:00
|
|
|
- run: dart format -o none --set-exit-if-changed .
|
2020-11-20 09:01:18 -08:00
|
|
|
name: dartfmt
|
|
|
|
- run: dart analyze --fatal-infos --fatal-warnings
|
|
|
|
# tests and coverage
|
2020-11-20 11:30:21 -08:00
|
|
|
- run: dart test #--coverage=coverage
|
|
|
|
# - uses: actions/upload-artifact@v2
|
|
|
|
# with:
|
|
|
|
# name: sqlparser-coverage-data
|
|
|
|
# path: |
|
|
|
|
# sqlparser/coverage/
|
|
|
|
# sqlparser/.dart_tool/package_config.json
|
|
|
|
# retention-days: 1
|
2020-11-20 09:01:18 -08:00
|
|
|
|
|
|
|
misc_integration_tests:
|
|
|
|
name: "Integration tests"
|
2021-05-25 10:12:30 -07:00
|
|
|
needs: [compile_sqlite3]
|
2020-11-20 10:36:03 -08:00
|
|
|
runs-on: ubuntu-20.04
|
2021-11-11 05:40:41 -08:00
|
|
|
services:
|
|
|
|
postgres:
|
|
|
|
image: postgres
|
|
|
|
env:
|
|
|
|
POSTGRES_PASSWORD: postgres
|
|
|
|
options: >-
|
|
|
|
--health-cmd pg_isready
|
|
|
|
--health-interval 10s
|
|
|
|
--health-timeout 5s
|
|
|
|
--health-retries 5
|
|
|
|
ports:
|
|
|
|
- 5432:5432
|
2020-11-20 09:01:18 -08:00
|
|
|
steps:
|
2020-11-20 09:03:42 -08:00
|
|
|
- uses: actions/checkout@v2
|
2021-11-14 03:20:42 -08:00
|
|
|
- uses: dart-lang/setup-dart@v1
|
2020-11-20 09:14:39 -08:00
|
|
|
with:
|
|
|
|
release-channel: beta
|
2021-05-25 10:12:30 -07:00
|
|
|
- name: Download sqlite3
|
|
|
|
uses: actions/download-artifact@v2
|
|
|
|
with:
|
|
|
|
name: sqlite3
|
|
|
|
path: /tmp/sqlite/out/
|
|
|
|
- name: Use downloaded sqlite3
|
|
|
|
run: |
|
|
|
|
chmod a+x /tmp/sqlite/out/sqlite3
|
|
|
|
echo "/tmp/sqlite/out" >> $GITHUB_PATH
|
|
|
|
echo "LD_LIBRARY_PATH=/tmp/sqlite/out" >> $GITHUB_ENV
|
2020-11-20 09:01:18 -08:00
|
|
|
- run: tool/misc_integration_test.sh
|
|
|
|
|
2020-11-20 11:30:21 -08:00
|
|
|
# upload_coverage:
|
|
|
|
# runs-on: ubuntu-20.04
|
|
|
|
# needs: [moor, sqlparser]
|
|
|
|
# steps:
|
|
|
|
# - uses: actions/checkout@v2
|
2021-11-14 03:20:42 -08:00
|
|
|
# - uses: dart-lang/setup-dart@v1
|
2020-11-20 11:30:21 -08:00
|
|
|
# - run: dart pub upgrade
|
|
|
|
# name: "Setup coverage processor"
|
2020-12-10 06:19:02 -08:00
|
|
|
# working-directory: extras/tooling
|
2020-11-20 11:30:21 -08:00
|
|
|
# - uses: actions/download-artifact@v2
|
|
|
|
# with:
|
|
|
|
# name: moor-coverage-data
|
|
|
|
# path: moor/
|
|
|
|
# - uses: actions/download-artifact@v2
|
|
|
|
# with:
|
|
|
|
# name: sqlparser-coverage-data
|
|
|
|
# path: sqlparser/
|
2020-12-10 06:19:02 -08:00
|
|
|
# - run: dart run extras/tooling/bin/coverage.dart
|
2020-11-20 11:30:21 -08:00
|
|
|
# name: "Format coverage from raw data"
|
|
|
|
# - uses: codecov/codecov-action@v1
|
|
|
|
# with:
|
2020-11-25 08:57:36 -08:00
|
|
|
# file: lcov.info
|