Merge branch 'develop' into feature/DEVSU-2815-make-create-report-acc… #2508
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: build | |
| on: | |
| - push | |
| - workflow_dispatch | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| node: [16, 18, 20] | |
| # TODO: readd node versions: node: [14, 16, 18, 20] | |
| name: node-${{ matrix.node }} | |
| services: | |
| postgres: | |
| # Docker Hub image | |
| image: postgres:13-alpine # Should match Dockerfile.db | |
| env: | |
| POSTGRES_PASSWORD: postgres | |
| ports: | |
| - 5432:5432 | |
| # Set health checks to wait until postgres has started | |
| options: >- | |
| --health-cmd pg_isready | |
| --health-interval 10s | |
| --health-timeout 5s | |
| --health-retries 5 | |
| redis: | |
| # Docker Hub image | |
| image: redis:6.2-alpine | |
| # Set health checks to wait until redis has started | |
| options: >- | |
| --health-cmd "redis-cli ping" | |
| --health-interval 10s | |
| --health-timeout 5s | |
| --health-retries 5 | |
| ports: | |
| # Maps port 6379 on service container to the host | |
| - 6379:6379 | |
| steps: | |
| - uses: actions/checkout@v3 | |
| - uses: actions/setup-node@v3 | |
| with: | |
| node-version: ${{ matrix.node }} | |
| - run: bash ./demo/restore_iprdb_dump.sh | |
| env: | |
| POSTGRES_PASSWORD: postgres | |
| SERVICE_USER: ipr_service | |
| SERVICE_PASSWORD: demo | |
| DATABASE_NAME: ipr_demo | |
| TEMPLATE_NAME: templateipr | |
| DB_DUMP_LOCATION: ./demo/ipr_demodb.postgres.dump | |
| PGHOST: localhost | |
| - run: npm ci --verbose | |
| - run: bash ./migrationTools/migratedb.sh | |
| env: | |
| IPR_SERVICE_USER: ipr_service | |
| IPR_SERVICE_PASS: demo | |
| IPR_DATABASE_SERVER: localhost | |
| IPR_DATABASE_NAME: ipr_demo | |
| IPR_GRAPHKB_PASSWORD: demo | |
| IPR_DATABASE_PASSWORD: demo | |
| - run: npm run test | |
| env: | |
| IPR_DATABASE_HOSTNAME: localhost | |
| IPR_DATABASE_NAME: ipr_demo | |
| IPR_DATABASE_PASSWORD: demo | |
| IPR_DATABASE_USER: ipr_service | |
| IPR_GRAPHKB_PASSWORD: demo | |
| IPR_KEYCLOAK_KEYFILE: test/keys/authkey.pem | |
| IPR_TESTING_PASSWORD: iprdemo | |
| IPR_TESTING_USERNAME: iprdemo | |
| IPR_REDIS_HOST: localhost | |
| - uses: codecov/codecov-action@v3 | |
| with: | |
| yml: codecov.yml | |
| token: ${{ secrets.CODECOV_TOKEN }} | |
| fail_ci_if_error: true | |
| if: matrix.node == 16 | |
| - uses: EnricoMi/publish-unit-test-result-action@v1.6 | |
| with: | |
| github_token: ${{ secrets.GITHUB_TOKEN }} | |
| files: coverage/junit.xml | |
| if: matrix.node == 16 | |
| docker: | |
| runs-on: ubuntu-latest | |
| name: docker build | |
| steps: | |
| - uses: actions/checkout@v3 | |
| - name: build the API docker container | |
| run: | | |
| docker build --file Dockerfile --tag pori/ipr-api . |