mirror of
https://github.com/bckelley/cgm-remote-monitor.git
synced 2026-08-24 03:14:12 -05:00
add NodeJS 16.x support. drop NodeJS 12.x support.It reached End-of-Life status on 30 April 2022 allow NodeJS 18.x support to run for CI upgrade webpack and webpack-cli update browserlist and browser documentation, config is now at .browserslistrc update README.md for browsers and Node versions fix typos in comments in lib/client/hashauth.js and webpack/webpack.config from https://github.com/nightscout/cgm-remote-monitor/pull/7440
94 lines
3.0 KiB
YAML
94 lines
3.0 KiB
YAML
name: CI test and publish Docker image
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- master
|
|
- dev
|
|
pull_request:
|
|
branches:
|
|
- master
|
|
- dev
|
|
|
|
jobs:
|
|
test:
|
|
name: Run Tests
|
|
runs-on: ubuntu-latest
|
|
strategy:
|
|
matrix:
|
|
node-version: [14.x, 16.x, 18.x]
|
|
mongodb-version: [4.2, 4.4]
|
|
|
|
steps:
|
|
- name: Git Checkout
|
|
uses: actions/checkout@v2
|
|
|
|
- name: Use Node.js ${{ matrix.node-version }}
|
|
uses: actions/setup-node@v1
|
|
with:
|
|
node-version: ${{ matrix.node-version }}
|
|
|
|
- name: Start MongoDB ${{ matrix.mongodb-version }}
|
|
uses: supercharge/mongodb-github-action@1.3.0
|
|
with:
|
|
mongodb-version: ${{ matrix.mongodb-version }}
|
|
|
|
- name: Install dependencies
|
|
run: npm install
|
|
- name: Run Tests
|
|
run: npm run-script test-ci
|
|
- name: Send Coverage
|
|
run: npm run-script coverage
|
|
|
|
publish_dev:
|
|
name: Publish dev branch to Docker Hub
|
|
needs: test
|
|
runs-on: ubuntu-latest
|
|
if: github.ref == 'refs/heads/dev' && github.repository_owner == 'nightscout'
|
|
env:
|
|
DOCKER_IMAGE: nightscout/cgm-remote-monitor
|
|
steps:
|
|
- name: Login to Docker Hub
|
|
uses: docker/login-action@v1
|
|
with:
|
|
username: ${{ secrets.DOCKER_USER }}
|
|
password: ${{ secrets.DOCKER_PASS }}
|
|
- name: Clean git Checkout
|
|
if: success()
|
|
uses: actions/checkout@v2
|
|
- name: Build, tag and push the dev Docker image
|
|
if: success()
|
|
run: |
|
|
docker build --no-cache=true -t ${{ env.DOCKER_IMAGE }}:dev_${{ github.sha }} .
|
|
docker image push ${{ env.DOCKER_IMAGE }}:dev_${{ github.sha }}
|
|
docker tag ${{ env.DOCKER_IMAGE }}:dev_${{ github.sha }} ${{ env.DOCKER_IMAGE }}:latest_dev
|
|
docker image push ${{ env.DOCKER_IMAGE }}:latest_dev
|
|
|
|
publish_master:
|
|
name: Publish master branch to Docker Hub
|
|
needs: test
|
|
runs-on: ubuntu-latest
|
|
if: github.ref == 'refs/heads/master' && github.repository_owner == 'nightscout'
|
|
env:
|
|
DOCKER_IMAGE: nightscout/cgm-remote-monitor
|
|
steps:
|
|
- name: Login to Docker Hub
|
|
uses: docker/login-action@v1
|
|
with:
|
|
username: ${{ secrets.DOCKER_USER }}
|
|
password: ${{ secrets.DOCKER_PASS }}
|
|
- name: Clean git Checkout
|
|
if: success()
|
|
uses: actions/checkout@v2
|
|
- name: get-npm-version
|
|
if: success()
|
|
id: package-version
|
|
uses: martinbeentjes/npm-get-version-action@master
|
|
- name: Build, tag and push the master Docker image
|
|
if: success()
|
|
run: |
|
|
docker build --no-cache=true -t ${{ env.DOCKER_IMAGE }}:${{ steps.package-version.outputs.current-version }} .
|
|
docker image push ${{ env.DOCKER_IMAGE }}:${{ steps.package-version.outputs.current-version }}
|
|
docker tag ${{ env.DOCKER_IMAGE }}:${{ steps.package-version.outputs.current-version }} ${{ env.DOCKER_IMAGE }}:latest
|
|
docker image push ${{ env.DOCKER_IMAGE }}:latest
|