From ab4b7b34a60ea4170c3640c556bd4c3914328575 Mon Sep 17 00:00:00 2001 From: uki00a Date: Sun, 26 Jan 2020 22:30:58 +0900 Subject: [PATCH 1/2] build: setup github actions --- .circleci/config.yml | 80 ---------------------------------- .github/ workflows/ci.yml | 12 +++++ .travis.yml | 21 --------- ormconfig.circleci.json | 92 --------------------------------------- ormconfig.gh-actions.json | 9 ++++ ormconfig.travis.json | 82 ---------------------------------- test.ts | 4 ++ test/deps/mocha.ts | 4 ++ 8 files changed, 29 insertions(+), 275 deletions(-) delete mode 100644 .circleci/config.yml create mode 100644 .github/ workflows/ci.yml delete mode 100644 .travis.yml delete mode 100644 ormconfig.circleci.json create mode 100644 ormconfig.gh-actions.json delete mode 100644 ormconfig.travis.json create mode 100644 test.ts diff --git a/.circleci/config.yml b/.circleci/config.yml deleted file mode 100644 index d8ad707ec..000000000 --- a/.circleci/config.yml +++ /dev/null @@ -1,80 +0,0 @@ -# Javascript Node CircleCI 2.0 configuration file -# Check https://circleci.com/docs/2.0/language-javascript/ for more details -version: 2 -jobs: - build: - working_directory: ~/typeorm - docker: - # specify pre-built docker images - # documented at https://circleci.com/docs/2.0/circleci-images/ - - image: circleci/node:10.15.0 - - image: mysql:5.7.24 - environment: - MYSQL_ROOT_PASSWORD: "admin" - MYSQL_DATABASE: "test" - - image: mariadb:10.1.37 - name: mariadb - environment: - MYSQL_ROOT_PASSWORD: "admin" - MYSQL_DATABASE: "test" - - image: circleci/postgres:9.6.11-postgis - environment: - POSTGRES_USER: "test" - POSTGRES_PASSWORD: "test" - POSTGRES_DB: "test" - - image: circleci/mongo:3.4.18 -# - image: "store/saplabs/hanaexpress:2.00.040.00.20190729.1" -# auth: -# username: $DOCKER_USER -# password: $DOCKER_PASSWORD -## name: hanaexpress -## container_name: "typeorm-hanaexpress" -## hostname: hxe -# command: ['--passwords-url', 'https://raw.githubusercontent.com/typeorm/typeorm/b119f7c3b8748aea9c77c7bc42b8e1be209b43ec/docker/hana/hxe-config.json', '--agree-to-sap-license'] -## ulimits: -## nofile: 1048576 -## sysctls: -## - kernel.shmmax=1073741824 -## - net.ipv4.ip_local_port_range=40000 60999 -## - kernel.shmmni=524288 -## - kernel.shmall=8388608 -## volumes: -## - volume-hana-xe:/hana/mounts -## - ./docker/hana/hxe-config.json:/hana/hxe-config.json -## ports: -## - 39013:39013 -## - 39017:39017 -## - 39041-39045:39041-39045 -## - 1128-1129:1128-1129 -## - 59013-59014:59013-59014 - # - image: mcr.microsoft.com/mssql/server:2017-GA-ubuntu - # environment: - # SA_PASSWORD: "Admin12345" - # ACCEPT_EULA: "Y" - # - image: cockroachdb/cockroach-unstable:latest - # command: start --insecure - - steps: - - checkout - - run: sudo npm install -g npm@latest - - run: cp ormconfig.circleci.json ormconfig.json - - # Download and cache dependencies - - restore_cache: - keys: - - v1-dependencies-{{ checksum "package.json" }} - # fallback to using the latest cache if no exact match is found - - v1-dependencies- - - - run: npm install - - - save_cache: - paths: - - node_modules - key: v1-dependencies-{{ checksum "package.json" }} - - # - run: docker-compose up -d - - # run tests - - run: npm run lint - - run: npm test diff --git a/.github/ workflows/ci.yml b/.github/ workflows/ci.yml new file mode 100644 index 000000000..23a4abdff --- /dev/null +++ b/.github/ workflows/ci.yml @@ -0,0 +1,12 @@ +name: ci +on: [push, pull_request] +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@master + - uses: denolib/setup-deno@master + - name: Run tests + run: | + cp ./ormconfig.gh-actions.json ./ormconfig.json + deno run --allow-read --allow-write --config ./tsconfig.json ./test.ts diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 3fa8b1987..000000000 --- a/.travis.yml +++ /dev/null @@ -1,21 +0,0 @@ -language: node_js -node_js: - - 13 - - 12 - - 10 - -services: - - docker - -before_script: - - sudo service mysql stop - - sudo service postgresql stop - - docker-compose up -d - - cp ormconfig.travis.json ormconfig.json - -script: - - npm run lint - - npx nyc npm test - -after_success: - - bash <(curl -s https://codecov.io/bash) diff --git a/ormconfig.circleci.json b/ormconfig.circleci.json deleted file mode 100644 index a17fbc5c7..000000000 --- a/ormconfig.circleci.json +++ /dev/null @@ -1,92 +0,0 @@ -[ - { - "skip": false, - "name": "mysql", - "type": "mysql", - "host": "localhost", - "port": 3306, - "username": "root", - "password": "admin", - "database": "test" - }, - { - "skip": false, - "name": "mariadb", - "type": "mariadb", - "host": "mariadb", - "port": 3306, - "username": "root", - "password": "admin", - "database": "test" - }, - { - "skip": false, - "name": "sqlite", - "type": "sqlite", - "database": "temp/sqlitedb.db" - }, - { - "skip": false, - "name": "postgres", - "type": "postgres", - "host": "localhost", - "port": 5432, - "username": "test", - "password": "test", - "database": "test" - }, - { - "skip": false, - "name": "sqljs", - "type": "sqljs" - }, - { - "skip": true, - "name": "mssql", - "type": "mssql", - "host": "localhost", - "username": "sa", - "password": "Admin12345", - "database": "tempdb" - }, - { - "skip": true, - "name": "oracle", - "type": "oracle", - "host": "localhost", - "username": "system", - "password": "oracle", - "port": 1521, - "sid": "xe.oracle.docker" - }, - { - "skip": true, - "name": "cockroachdb", - "type": "cockroachdb", - "host": "localhost", - "port": 26257, - "username": "root", - "password": "", - "database": "defaultdb" - }, - { - "skip": true, - "name": "sap", - "type": "sap", - "host": "localhost", - "port": 39015, - "username": "SYSTEM", - "password": "HXEHana1", - "database": "HXE", - "logging": false - }, - { - "skip": false, - "disabledIfNotEnabledImplicitly": true, - "name": "mongodb", - "type": "mongodb", - "database": "test", - "useNewUrlParser": true, - "useUnifiedTopology": true - } -] diff --git a/ormconfig.gh-actions.json b/ormconfig.gh-actions.json new file mode 100644 index 000000000..a8d8df78e --- /dev/null +++ b/ormconfig.gh-actions.json @@ -0,0 +1,9 @@ +[ + { + "skip": false, + "name": "sqlite", + "type": "sqlite", + "database": "./sqlite.db", + "logging": true + } +] diff --git a/ormconfig.travis.json b/ormconfig.travis.json deleted file mode 100644 index fb1a1d47e..000000000 --- a/ormconfig.travis.json +++ /dev/null @@ -1,82 +0,0 @@ -[ - { - "skip": false, - "name": "mysql", - "type": "mysql", - "host": "localhost", - "port": 3306, - "username": "root", - "password": "admin", - "database": "test" - }, - { - "skip": false, - "name": "mariadb", - "type": "mariadb", - "host": "localhost", - "port": 3307, - "username": "root", - "password": "admin", - "database": "test" - }, - { - "skip": false, - "name": "sqlite", - "type": "sqlite", - "database": "temp/sqlitedb.db" - }, - { - "skip": false, - "name": "postgres", - "type": "postgres", - "host": "localhost", - "port": 5432, - "username": "test", - "password": "test", - "database": "test", - "logging": false - }, - { - "skip": false, - "name": "sqljs", - "type": "sqljs" - }, - { - "skip": false, - "name": "mssql", - "type": "mssql", - "host": "localhost", - "username": "sa", - "password": "Admin12345", - "database": "tempdb" - }, - { - "skip": true, - "name": "oracle", - "type": "oracle", - "host": "localhost", - "username": "system", - "password": "oracle", - "port": 1521, - "sid": "xe.oracle.docker" - }, - { - "skip": false, - "name": "cockroachdb", - "type": "cockroachdb", - "host": "localhost", - "port": 26257, - "username": "root", - "password": "", - "database": "defaultdb" - }, - { - "skip": false, - "disabledIfNotEnabledImplicitly": true, - "name": "mongodb", - "type": "mongodb", - "database": "test", - "useNewUrlParser": true, - "useUnifiedTopology": true - } -] diff --git a/test.ts b/test.ts new file mode 100644 index 000000000..a36c30be3 --- /dev/null +++ b/test.ts @@ -0,0 +1,4 @@ +import {runTests} from "./test/deps/mocha.ts"; +import "./test/integration/sample1-simple-entity.ts"; + +runTests(); diff --git a/test/deps/mocha.ts b/test/deps/mocha.ts index 272d33c4c..6fb2109c4 100644 --- a/test/deps/mocha.ts +++ b/test/deps/mocha.ts @@ -2,6 +2,10 @@ import "https://unpkg.com/mocha@7.0.0/mocha.js"; mocha.setup({ ui: 'bdd', reporter: 'spec' }); +export function runTests(): void { + mocha.run(); +} + export function runIfMain(meta: ImportMeta): void { if (meta.main) { mocha.run(); From c104e67d79ee33fde9458f0c3a9d2df884b8ec7a Mon Sep 17 00:00:00 2001 From: uki00a Date: Sun, 2 Feb 2020 22:46:33 +0900 Subject: [PATCH 2/2] fix --- ormconfig.gh-actions.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ormconfig.gh-actions.json b/ormconfig.gh-actions.json index a8d8df78e..b13d5ac7d 100644 --- a/ormconfig.gh-actions.json +++ b/ormconfig.gh-actions.json @@ -3,7 +3,7 @@ "skip": false, "name": "sqlite", "type": "sqlite", - "database": "./sqlite.db", + "database": "temp/sqlitedb.db", "logging": true } ]