From ee634f1dc009b926067f4a5106b8a4e1f763313d Mon Sep 17 00:00:00 2001 From: kononnable Date: Wed, 24 Feb 2021 20:40:26 +0100 Subject: [PATCH] change CI to github actions travis demand payment and stopped working due to policy changes and a bug --- .github/workflows/ci-tests.yml | 71 ++++++++++++++++++++++++++++++++++ .github/workflows/oracle.yml | 70 +++++++++++++++++++++++++++++++++ .travis.yml | 52 ------------------------- README.md | 1 - package.json | 2 +- 5 files changed, 142 insertions(+), 54 deletions(-) create mode 100644 .github/workflows/ci-tests.yml create mode 100644 .github/workflows/oracle.yml delete mode 100644 .travis.yml diff --git a/.github/workflows/ci-tests.yml b/.github/workflows/ci-tests.yml new file mode 100644 index 0000000..b059e0b --- /dev/null +++ b/.github/workflows/ci-tests.yml @@ -0,0 +1,71 @@ +name: CI tests for most supported db drivers + +on: + push: + branches-ignore: + - "no-engines" + tags-ignore: + - "*-no-engines" + pull_request: + +env: + POSTGRES_Skip: 0 + POSTGRES_Host: localhost + POSTGRES_Port: 5432 + POSTGRES_Username: test + POSTGRES_Password: test + POSTGRES_Database: test + POSTGRES_SSL: 0 + MYSQL_Skip: 0 + MYSQL_Host: localhost + MYSQL_Port: 3306 + MYSQL_Username: root + MYSQL_Password: admin + MYSQL_Database: test + MYSQL_SSL: 0 + MARIADB_Skip: 0 + MARIADB_Host: localhost + MARIADB_Port: 3307 + MARIADB_Username: root + MARIADB_Password: admin + MARIADB_Database: test + MARIADB_SSL: 0 + MSSQL_Skip: 0 + MSSQL_Host: localhost + MSSQL_Port: 1433 + MSSQL_Username: sa + MSSQL_Password: Admin12345 + MSSQL_Database: typeorm_mg + MSSQL_SSL: 0 + SQLITE_Skip: 0 + SQLITE_Database: /tmp/sqlitedb.db + +jobs: + test: + runs-on: ubuntu-latest + strategy: + matrix: + node-version: [10.x, 12.x, 14.x, 15.x] + + steps: + + - name: Checkout the repo + uses: actions/checkout@v2 + + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v1 + with: + node-version: ${{ matrix.node-version }} + + - name: Setup containers + run: docker-compose up -d mysql mariadb postgres mssql + + - name: Install dependencies + run: npm ci + + - name: Test + run: npm t + + - name: Push coverage + if: github.ref == 'ref/head/master' + uses: codecov/codecov-action@v1 diff --git a/.github/workflows/oracle.yml b/.github/workflows/oracle.yml new file mode 100644 index 0000000..b37d03c --- /dev/null +++ b/.github/workflows/oracle.yml @@ -0,0 +1,70 @@ +name: CI tests for oracle db driver + +on: + push: + branches-ignore: + - "no-engines" + tags-ignore: + - "*-no-engines" + pull_request: + +env: + ORACLE_Skip: 0 + ORACLE_Host: localhost + ORACLE_Port: 1521 + ORACLE_SSL: 0 + ORACLE_UsernameSys: sys + ORACLE_PasswordSys: Oradoc_db1 + ORACLE_Database: orclpdb1.localdomain + ORACLE_Username: typeorm_mg + ORACLE_Password: Passw0rd + +jobs: + test: + runs-on: ubuntu-latest + strategy: + matrix: + node-version: [10.x, 12.x, 14.x, 15.x] + + steps: + + - name: Login to registry + uses: docker/login-action@v1 + with: + username: ${{ secrets.DOCKERHUB_LOGIN }} + password: ${{ secrets.DOCKERHUB_PASSWORD }} + + - name: Checkout the repo + uses: actions/checkout@v2 + + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v1 + with: + node-version: ${{ matrix.node-version }} + + - name: Setup containers + run: docker-compose up -d oracle oracle_client + + - name: Install dependencies + run: npm ci + + - name: Setup oracle client + run: | + wget https://download.oracle.com/otn_software/linux/instantclient/195000/instantclient-basiclite-linux.x64-19.5.0.0.0dbru.zip + unzip instantclient-basiclite-linux.x64-19.5.0.0.0dbru.zip -d /tmp/oracle + wget https://download.oracle.com/otn_software/linux/instantclient/195000/instantclient-sqlplus-linux.x64-19.5.0.0.0dbru.zip + unzip instantclient-sqlplus-linux.x64-19.5.0.0.0dbru.zip -d /tmp/oracle + sudo sh -c "echo /tmp/oracle/instantclient_19_5 > /etc/ld.so.conf.d/oracle-instantclient.conf";sudo ldconfig + sh -c 'echo WHENEVER SQLERROR EXIT FAILURE > /tmp/user.sql; echo CREATE USER typeorm_mg IDENTIFIED BY Passw0rd\; >> /tmp/user.sql; echo GRANT CONNECT TO typeorm_mg\; >> /tmp/user.sql; echo GRANT UNLIMITED TABLESPACE TO typeorm_mg\; >> /tmp/user.sql; echo exit >> /tmp/user.sql' + sudo apt install libaio1 + until /tmp/oracle/instantclient_19_5/sqlplus -L -S sys/Oradoc_db1@//localhost:1521/orclpdb1.localdomain as sysdba @/tmp/user.sql ; do echo waiting for oracle; sleep 10; done; + npm install oracledb --no-save + + - name: Test + run: npm t + env: + LD_LIBRARY_PATH: /tmp/oracle/instantclient_19_5 + + - name: Push coverage + if: github.ref == 'ref/head/master' + uses: codecov/codecov-action@v1 diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 407a748..0000000 --- a/.travis.yml +++ /dev/null @@ -1,52 +0,0 @@ -language: node_js -node_js: -- 15 -- 14 -- 12 -- 10 -cache: npm -branches: - except: - - no-engines -services: -- docker -env: - jobs: - - POSTGRES_Skip=0 POSTGRES_Host=localhost POSTGRES_Port=5432 POSTGRES_Username=test - POSTGRES_Password=test POSTGRES_Database=test POSTGRES_SSL=0 MYSQL_Skip=0 - MYSQL_Host=localhost MYSQL_Port=3306 MYSQL_Username=root MYSQL_Password=admin - MYSQL_Database=test MYSQL_SSL=0 MARIADB_Skip=0 MARIADB_Host=localhost MARIADB_Port=3307 - MARIADB_Username=root MARIADB_Password=admin MARIADB_Database=test MARIADB_SSL=0 - MSSQL_Skip=0 MSSQL_Host=localhost MSSQL_Port=1433 MSSQL_Username=sa MSSQL_Password=Admin12345 - MSSQL_Database=typeorm_mg MSSQL_SSL=0 - ORACLE_Skip=0 - ORACLE_Host=localhost - ORACLE_Port=1521 - ORACLE_SSL=0 - ORACLE_UsernameSys=sys - ORACLE_PasswordSys=Oradoc_db1 - ORACLE_Database=orclpdb1.localdomain - ORACLE_Username=typeorm_mg - ORACLE_Password=Passw0rd - SQLITE_Skip=0 - SQLITE_Database=/tmp/sqlitedb.db -before_install: -- sudo service mysql stop -- sudo service postgresql stop -- images=(mysql mariadb postgres mssql) -- if [ -z "$DOCKER_USERNAME" ]; then echo "DOCKER_USERNAME is unset"; else echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin; fi -- if [ -z "$DOCKER_USERNAME" ]; then export ORACLE_Skip=1; else images=(${images[@]} oracle oracle_client); fi -- if [ -n "$DOCKER_USERNAME" ]; then docker-compose up -d ${images[@]}; fi -- echo ${images[@]} -- docker-compose pull --ignore-pull-failures ${images[@]} -- docker-compose up -d ${images[@]} -before_script: -- if [ -n "$DOCKER_USERNAME" ]; then mkdir /opt/oracle; npm i oracledb --no-save; docker cp typeorm-mg-oracle-client:/usr/lib/oracle/12.2/client64/lib /opt/oracle/instantclient_12_2; fi -- export LD_LIBRARY_PATH=/opt/oracle/instantclient_12_2:$LD_LIBRARY_PATH -script: -- travis_retry sh -c 'sleep 90 && npm t -- --colors' -after_success: -- codecov -after_failure: - - docker-compose logs - - docker ps diff --git a/README.md b/README.md index 521169b..37a4c6f 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,5 @@ # typeorm-model-generator -[![Build Status](https://travis-ci.org/Kononnable/typeorm-model-generator.svg?branch=master)](https://travis-ci.org/Kononnable/typeorm-model-generator) [![npm version](https://badge.fury.io/js/typeorm-model-generator.svg)](https://badge.fury.io/js/typeorm-model-generator) [![codecov](https://codecov.io/gh/Kononnable/typeorm-model-generator/branch/master/graph/badge.svg)](https://codecov.io/gh/Kononnable/typeorm-model-generator) diff --git a/package.json b/package.json index 6e60909..208bbe2 100644 --- a/package.json +++ b/package.json @@ -91,7 +91,7 @@ } }, "nyc": { - "check-coverage": true, + "check-coverage": false, "all": true, "extension": [ ".ts",