Skip to content

Merge remote-tracking branch 'origin/master' into eh/TECH/upgrade_cyp… #8117

Merge remote-tracking branch 'origin/master' into eh/TECH/upgrade_cyp…

Merge remote-tracking branch 'origin/master' into eh/TECH/upgrade_cyp… #8117

Workflow file for this run

name: 'dhis2: verify app'
on:
push:
branches:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
env:
GIT_AUTHOR_NAME: '@dhis2-bot'
GIT_AUTHOR_EMAIL: '[email protected]'
GIT_COMMITTER_NAME: '@dhis2-bot'
GIT_COMMITTER_EMAIL: '[email protected]'
GH_TOKEN: ${{ secrets.DHIS2_BOT_GITHUB_TOKEN }}
CI: true
jobs:
install:
runs-on: ubuntu-latest
if: "!contains(github.event.head_commit.message, '[skip ci]')"
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: 14.x
- uses: actions/cache@v2
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
with:
path: '**/node_modules'
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
- name: Install
if: steps.yarn-cache.outputs.cache-hit != 'true'
run: yarn install --frozen-lockfile
lint:
runs-on: ubuntu-latest
needs: install
if: "!contains(github.event.head_commit.message, '[skip ci]')"
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: 14.x
- uses: actions/cache@v2
id: yarn-cache
with:
path: '**/node_modules'
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
- name: Lint
run: yarn linter:check
flow:
runs-on: ubuntu-latest
if: "!contains(github.event.head_commit.message, '[skip ci]')"
needs: install
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: 14.x
- uses: actions/cache@v2
id: yarn-cache
with:
path: '**/node_modules'
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
- name: Flow
run: yarn flow:check
unit-tests:
runs-on: ubuntu-latest
needs: install
if: "!contains(github.event.head_commit.message, '[skip ci]')"
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: 14.x
- uses: actions/cache@v2
id: yarn-cache
with:
path: '**/node_modules'
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
- name: Unit tests
run: yarn test
instance-version:
runs-on: ubuntu-latest
needs: [lint, flow, unit-tests]
if: "!(startsWith(github.event.head_commit.message, 'fix(translations)') && github.actor == 'dhis2-bot') && !contains(github.event.head_commit.message, '[skip ci]')"
outputs:
version: ${{ steps.instance-version.outputs.version }}
steps:
- uses: dhis2/action-instance-version@v1
id: instance-version
with:
instance-url: ${{ secrets.CYPRESS_DHIS2_INSTANCES_BASE_URL }}/ca-test-dev
username: ${{ secrets.CYPRESS_DHIS2_USERNAME }}
password: ${{ secrets.CYPRESS_DHIS2_PASSWORD }}
cypress-dev:
runs-on: ubuntu-latest
needs: instance-version
container: cypress/browsers:node14.7.0-chrome84
strategy:
# when one test fails, DO NOT cancel the other
# containers, because this will kill Cypress processes
# leaving the Dashboard hanging ...
# https://github.com/cypress-io/github-action/issues/48
fail-fast: false
matrix:
containers: [1, 2, 3, 4, 5]
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: 14.x
- name: Cypress run
uses: cypress-io/github-action@v4
with:
record: true
parallel: true
group: e2e-chrome-parallel-dev
browser: chrome
start: yarn start:forCypress
wait-on: http://localhost:3000
wait-on-timeout: 300
env:
CI: true
CYPRESS_RECORD_KEY: '6b0bce0d-a4e8-417b-bbee-9157cbe9a999'
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
CYPRESS_dhis2BaseUrl: ${{ secrets.CYPRESS_DHIS2_INSTANCES_BASE_URL }}/ca-test-dev
CYPRESS_dhis2InstanceVersion: ${{ needs.instance-version.outputs.version }}
CYPRESS_dhis2Username: ${{ secrets.CYPRESS_DHIS2_USERNAME }}
CYPRESS_dhis2Password: ${{ secrets.CYPRESS_DHIS2_PASSWORD }}
build:
runs-on: ubuntu-latest
needs: [lint, flow, unit-tests]
if: "!contains(github.event.head_commit.message, '[skip ci]')"
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: 14.x
- uses: actions/cache@v2
id: yarn-cache
with:
path: '**/node_modules'
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
- name: Build
run: yarn build
- uses: actions/upload-artifact@v2
with:
name: app-build
path: |
**/build
!**/node_modules
retention-days: 1
release:
runs-on: ubuntu-latest
needs: build
if: "!github.event.push.repository.fork && !contains(github.event.head_commit.message, '[skip ci]') && github.actor != 'dependabot[bot]'"
steps:
- uses: actions/checkout@v2
with:
token: ${{ env.GH_TOKEN }}
- uses: actions/setup-node@v1
with:
node-version: 14.x
- uses: actions/download-artifact@v2
with:
name: app-build
- uses: actions/cache@v2
id: yarn-cache
with:
path: '**/node_modules'
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
- uses: dhis2/action-semantic-release@ignore-app-hub-lib
with:
publish-apphub: true
publish-github: true
github-token: ${{ env.GH_TOKEN }}
apphub-token: ${{ secrets.DHIS2_BOT_APPHUB_TOKEN }}
- uses: dhis2/deploy-build@specify-packages
with:
build-dir: build/app
github-token: ${{ env.GH_TOKEN }}
packages: capture-app