Skip to content

Commit

Permalink
ci: abstract test
Browse files Browse the repository at this point in the history
  • Loading branch information
ismay committed Jun 10, 2024
1 parent f2ff3cd commit 474952b
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 49 deletions.
51 changes: 2 additions & 49 deletions .github/workflows/dhis2-verify-app.yml
Original file line number Diff line number Diff line change
@@ -1,19 +1,10 @@
name: 'dhis2: verify (app)'

# Requirements:
#
# - Org secrets:
# DHIS2_BOT_GITHUB_TOKEN
# DHIS2_BOT_APPHUB_TOKEN
# - Enable the 'jobs.e2e' section if applicable
# - Customize the properties if needed:
# 'jobs.release.steps.*.cwd'
# 'jobs.release.steps.*.build-dir'

on: push

concurrency:
group: ${{ github.workflow}}-${{ github.ref }}
cancel-in-progress: true

env:
GIT_AUTHOR_NAME: '@dhis2-bot'
Expand All @@ -23,49 +14,11 @@ env:
D2_VERBOSE: true

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v3
with:
node-version: 20
cache: 'yarn'

- run: yarn install --frozen-lockfile

- name: Build
run: yarn d2-app-scripts build

- uses: actions/upload-artifact@v2
with:
name: app-build
path: |
**/build
!**/node_modules
retention-days: 1

lint:
uses: ./.github/workflows/lint.yml

test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v3
with:
node-version: 20
cache: 'yarn'

- run: yarn install --frozen-lockfile

# Can be removed if translations aren't required for tests,
# or if not using the App Platform
- name: Generate translations
run: yarn d2-app-scripts i18n generate

- name: Test
run: yarn d2-app-scripts test
uses: ./.github/workflows/test.yml

e2e:
runs-on: ubuntu-latest
Expand Down
15 changes: 15 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
on:
workflow_call:

jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
cache: 'yarn'
- run: yarn install --frozen-lockfile
- run: yarn d2-app-scripts i18n generate
- run: yarn d2-app-scripts test

0 comments on commit 474952b

Please sign in to comment.