Skip to content

Commit

Permalink
Update deploy
Browse files Browse the repository at this point in the history
  • Loading branch information
caleeli committed Aug 9, 2024
1 parent 143b075 commit f3edb5a
Showing 1 changed file with 128 additions and 4 deletions.
132 changes: 128 additions & 4 deletions .github/workflows/deploy-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,131 @@ on:
types: [opened, reopened, synchronize, edited, closed]
workflow_dispatch:
jobs:
run_deploy:
name: Run Build PM4-workflow
uses: processmaker/processmaker/.github/workflows/deploy-pm4.yml@develop
secrets: inherit
build:
name: Scan
runs-on: ubuntu-latest
steps:
########################################
# Checkout and Build vue-form-elements
########################################
- uses: actions/checkout@v2
with:
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
- name: Setup node env 🏗
uses: actions/setup-node@master
with:
node-version: 20
check-latest: true
cache: 'npm'

- name: Install vfe dependencies
run: npm ci && npm run build-bundle

- name: Link vue-form-elements
run: npm link

########################################
# Checkout and Build screen-builder
########################################
- name: Get screen-builder-version from PR body
uses: actions-ecosystem/action-regex-match@v2
id: screen-builder-version
with:
text: ${{ github.event.pull_request.body }}
regex: 'ci:screen-builder:([^\s]+)'

- name: Set env variable SCREEN_BUILDER_BRANCH (default=develop)
run: |
export SCREEN_BUILDER_BRANCH='develop'
if [[ ${{ contains(github.event.pull_request.body, 'ci:next') }} ]]; then
export SCREEN_BUILDER_BRANCH=next
fi
if [[ ${{ steps.screen-builder-version.outputs.match != '' }} ]]; then
export SCREEN_BUILDER_BRANCH=${{ steps.screen-builder-version.outputs.group1 }}
fi
echo "SCREEN_BUILDER_BRANCH=${SCREEN_BUILDER_BRANCH}" >> $GITHUB_ENV
- name: Checkout screen-builder
uses: actions/checkout@v4
with:
repository: ProcessMaker/screen-builder
path: screen-builder
ref: ${{ env.SCREEN_BUILDER_BRANCH }}

- name: Link vue-form-elements
run: npm link @proessmaker/vue-form-elements

- name: Install screen-builder dependencies
working-directory: screen-builder
run: npm ci && npm run build-bundle

########################################
# Checkout and Build screen-builder
########################################
- name: Cypress run
uses: cypress-io/github-action@v6
working-directory: screen-builder
with:
browser: chrome
install: false
start: npm run dev
wait-on: 'http://localhost:5173/'
config-file: cypress.config.js
spec: "tests/e2e/**/*"
record: true
parallel: true
group: 'CI - Chrome'
env:
# For recording and parallelization to work you must set your CYPRESS_RECORD_KEY
# in GitHub repo → Settings → Secrets → Actions
CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }}
# Creating a token https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/creating-a-personal-access-token
GITHUB_TOKEN: ${{ secrets.GIT_TOKEN }}
COMMIT_INFO_MESSAGE: ${{ github.event.pull_request.title }}
# re-enable PR comment bot
COMMIT_INFO_SHA: ${{github.event.pull_request.head.sha}}
- name: Upload Cypress Screenshots
uses: actions/upload-artifact@v4
working-directory: screen-builder
# Only capture images on failure
if: failure()
with:
name: cypress-screenshots
path: tests/e2e/screenshots

- name: Upload Cypress Videos
uses: actions/upload-artifact@v4
working-directory: screen-builder
# Only capture videos on failure
if: failure()
with:
name: cypress-videos
path: tests/e2e/videos
- run: ls -l .
- run: ls -R coverage .nyc_output

- name: Prepare coverage
working-directory: screen-builder
run: cp .nyc_output/out.json coverage/coverage-${{ matrix.containers }}.json
- name: Archive code coverage
uses: actions/upload-artifact@v4
working-directory: screen-builder
with:
name: coverage-${{ matrix.containers }}
path: ./coverage/coverage-${{ matrix.containers }}.json

- name: Create coverage report
run: npx nyc report --reporter html --reporter text --reporter json-summary --reporter lcov --report-dir coverage
- name: Store Artifacts
uses: actions/upload-artifact@v4
with:
name: code-coverage-report
path: |
coverage
.nyc_output
reports
- uses: sonarsource/sonarqube-scan-action@master
env:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
SONAR_HOST_URL: ${{ secrets.SONAR_HOST_URL }}

0 comments on commit f3edb5a

Please sign in to comment.