|
| 1 | +name: Create Release |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: [ master ] |
| 6 | + |
| 7 | +jobs: |
| 8 | + build: |
| 9 | + |
| 10 | + runs-on: ubuntu-latest |
| 11 | + |
| 12 | + strategy: |
| 13 | + matrix: |
| 14 | + python-version: [2.7] |
| 15 | + |
| 16 | + services: |
| 17 | + postgres: |
| 18 | + image: postgres |
| 19 | + env: |
| 20 | + POSTGRES_PASSWORD: password |
| 21 | + options: >- |
| 22 | + --health-cmd pg_isready |
| 23 | + --health-interval 10s |
| 24 | + --health-timeout 5s |
| 25 | + --health-retries 5 |
| 26 | + ports: |
| 27 | + - 5432:5432 |
| 28 | + |
| 29 | + mysql: |
| 30 | + image: mysql:5.6 |
| 31 | + env: |
| 32 | + MYSQL_ROOT_PASSWORD: password |
| 33 | + ports: |
| 34 | + - 3306:3306 |
| 35 | + options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3 |
| 36 | + |
| 37 | + steps: |
| 38 | + - name: Set up Python ${{ matrix.python-version }} |
| 39 | + uses: actions/setup-python@v2 |
| 40 | + with: |
| 41 | + python-version: ${{ matrix.python-version }} |
| 42 | + - name: Create test_openmrs mysql database |
| 43 | + run: | |
| 44 | + sudo apt-get update |
| 45 | + sudo apt-get install -y mysql-client |
| 46 | + mysql --host 127.0.0.1 --port 3306 -uroot -ppassword -e "SHOW DATABASES" |
| 47 | + mysql --host 127.0.0.1 --port 3306 -uroot -ppassword -e "create database test_openmrs;" |
| 48 | + mysql --host 127.0.0.1 --port 3306 -uroot -ppassword -e "CREATE USER 'test_user'@'127.0.0.1' IDENTIFIED BY 'password';" |
| 49 | + mysql --host 127.0.0.1 --port 3306 -uroot -ppassword -e "GRANT ALL PRIVILEGES ON *.* TO 'test_user'@'%' IDENTIFIED by 'password';" |
| 50 | + mysql --host 127.0.0.1 --port 3306 -uroot -ppassword -e "FLUSH PRIVILEGES;" |
| 51 | +
|
| 52 | +
|
| 53 | + - name: Create test_analytics postgres database |
| 54 | + run: | |
| 55 | + sudo apt-get update |
| 56 | + sudo apt-get install --yes --no-install-recommends postgresql-client |
| 57 | + - run: | |
| 58 | + PGPASSWORD=password psql -h 127.0.0.1 --port 5432 -U postgres -c "CREATE USER test_user WITH PASSWORD 'password' NOCREATEROLE SUPERUSER;" |
| 59 | + PGPASSWORD=password psql -h 127.0.0.1 --port 5432 -U postgres -c "CREATE DATABASE test_analytics WITH OWNER test_user;" |
| 60 | + PGPASSWORD=password psql -h 127.0.0.1 --port 5432 -U test_user test_analytics -c "CREATE SCHEMA bahmni_mart_scdf;" |
| 61 | +
|
| 62 | + - name: chckout code |
| 63 | + uses: actions/checkout@v2 |
| 64 | + - name: Set up JDK 1.8 |
| 65 | + uses: actions/setup-java@v1 |
| 66 | + with: |
| 67 | + java-version: 1.8 |
| 68 | + - run: ./scripts/travis/compile.sh |
| 69 | + - run: ./scripts/travis/test.sh |
| 70 | + - run: ./scripts/travis/createRpm.sh |
| 71 | + - shell: bash |
| 72 | + env: |
| 73 | + TOKEN: ${{ secrets.GH_TOKEN }} |
| 74 | + run: | |
| 75 | + ./scripts/github-release.sh bahmni "$TOKEN" |
| 76 | +
|
| 77 | +
|
0 commit comments