use new couchdb image, refactor compose file, add debug to bootstrap.js #287
Workflow file for this run
This file contains 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 cht-couch2pg and run unit test cases | |
on: [ push] | |
jobs: | |
build-and-test: | |
name: Build cht-couch2pg | |
runs-on: ubuntu-22.04 | |
timeout-minutes: 15 | |
strategy: | |
matrix: | |
node-version: [ 10, 12, 14 ] | |
steps: | |
- name: Get Docker Hub username | |
id: get-docker-hub-username | |
run: echo '::set-output name=dockerhub_username::${{ secrets.CI_DOCKER_USERNAME }}' | |
- name: Login to Docker Hub | |
uses: docker/login-action@v1 | |
with: | |
username: dockermedic | |
password: ${{ secrets.DOCKER_WRITE_PASSWORD }} | |
if: steps.get-docker-hub-username.outputs.dockerhub_username | |
- name: Checkout branch | |
uses: actions/checkout@v2 | |
- name: Build test image | |
run: docker compose -f docker-compose.test.yml build --build-arg node_version=${{ matrix.node-version }} cht-couch2pg | |
- name: Run grunt Tests | |
run: docker compose -f docker-compose.test.yml run cht-couch2pg grunt test | |
- name: Run entry point script Tests | |
run: docker compose -f docker-compose.test.yml run cht-couch2pg ./tests/bash/bats/bin/bats /app/tests/bash/test.bats | |
- name: Get tags to apply to image | |
id: meta | |
uses: docker/metadata-action@v3 | |
with: | |
images: medicmobile/cht-couch2pg | |
labels: | | |
org.opencontainers.image.title=cht-couch2pg | |
org.opencontainers.image.description= Software for creating read-only replicas of CouchDB data inside PostgreSQL | |
org.opencontainers.image.vendor=Medic | |
flavor: | | |
latest=auto | |
suffix=-node-${{matrix.node-version}} | |
- name: Build and Publish to Docker Hub | |
uses: docker/build-push-action@v2 | |
with: | |
context: . | |
push: ${{github.ref == 'refs/heads/main' || github.ref == 'refs/heads/arch-v3' || github.event.ref_type == 'tag' }} | |
tags: ${{ steps.meta.outputs.tags }} | |
labels: ${{ steps.meta.outputs.labels }} | |
target: cht-couch2pg |