mirror of
https://github.com/Alfresco/alfresco-content-app.git
synced 2025-07-31 17:38:28 +00:00
* [ACS-6956] Add GHA workflow to release ACA libs from branch * [ACS-6956] Add lint and unit-tests step
88 lines
2.1 KiB
YAML
88 lines
2.1 KiB
YAML
name: Release ACA libs from branch
|
|
run-name: Release ACA libs from branch ${{ github.ref_name }}
|
|
|
|
on:
|
|
workflow_dispatch:
|
|
inputs:
|
|
dry-run-flag:
|
|
description: 'enable dry-run'
|
|
required: false
|
|
type: boolean
|
|
default: true
|
|
|
|
env:
|
|
BASE_URL: ${{ secrets.PIPELINE_ENV_URL }}
|
|
|
|
jobs:
|
|
lint:
|
|
name: 'lint'
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v3
|
|
with:
|
|
fetch-depth: 0
|
|
|
|
- name: node
|
|
uses: actions/setup-node@v3
|
|
with:
|
|
node-version-file: '.nvmrc'
|
|
cache: 'npm'
|
|
- run: npm ci
|
|
- run: npm run affected:lint -- --base=origin/develop
|
|
- run: npm run stylelint
|
|
|
|
unit-tests:
|
|
needs: [lint]
|
|
name: "Unit tests: ${{ matrix.unit-tests.name }}"
|
|
runs-on: ubuntu-latest
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
unit-tests:
|
|
- name: "aca-content"
|
|
- name: "aca-shared"
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v3
|
|
with:
|
|
fetch-depth: 0
|
|
|
|
- name: node
|
|
uses: actions/setup-node@v3
|
|
with:
|
|
node-version-file: '.nvmrc'
|
|
cache: 'npm'
|
|
- uses: ./.github/actions/before-install
|
|
- run: npm ci
|
|
- run: npm run affected:test -- --browsers=ChromeHeadless --watch=false $TEST_OPTS --base=origin/develop
|
|
|
|
publish-libs:
|
|
needs: [lint, unit-tests]
|
|
name: "Publish libs to NPM and GitHub registry"
|
|
runs-on: ubuntu-latest
|
|
permissions:
|
|
packages: write
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v3
|
|
with:
|
|
fetch-depth: 2
|
|
|
|
- name: Setup node
|
|
uses: actions/setup-node@v3
|
|
with:
|
|
node-version-file: '.nvmrc'
|
|
cache: 'npm'
|
|
|
|
- uses: Alfresco/alfresco-build-tools/.github/actions/get-branch-name@v1.35.0
|
|
|
|
- name: publish
|
|
uses: ./.github/actions/publish-libs
|
|
with:
|
|
branch_name: ${{ env.BRANCH_NAME }}
|
|
github_token: ${{ secrets.BOT_GITHUB_TOKEN }}
|
|
npm_registry_token: ${{ secrets.NPM_REGISTRY_TOKEN }}
|
|
npm_tag: 'branch'
|
|
dry-run: ${{ inputs.dry-run-flag }}
|