TECH-1636: Create Github Actions config #14
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This workflow is triggered every time a change is pushed to any branches | |
# Github actions command reference: https://docs.github.com/en/actions/learn-github-actions/workflow-syntax-for-github-actions | |
name: On Code Change (PR) | |
# The workflow could also be triggered on PRs | |
on: | |
pull_request: | |
types: [opened, reopened, synchronize] | |
jobs: | |
build: | |
name: Build Components | |
runs-on: self-hosted | |
env: | |
NEXUS_INTERNAL_URL: ${{ secrets.NEXUS_INTERNAL_URL }} | |
container: | |
image: jahia/cimg-mvn-cache:ga_cimg_openjdk_11.0.20-node | |
credentials: | |
username: ${{ secrets.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_PASSWORD }} | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Execute yarn build | |
shell: bash | |
run: | | |
yarn install | |
yarn build | |
test: | |
name: Test Components | |
needs: [build] | |
runs-on: self-hosted | |
container: | |
image: jahia/cimg-mvn-cache:ga_cimg_openjdk_11.0.20-node | |
credentials: | |
username: ${{ secrets.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_PASSWORD }} | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Install dependencies | |
shell: bash | |
run: | | |
yarn install | |
- name: Run linting | |
shell: bash | |
run: | | |
yarn lint | |
- name: Run tests | |
shell: bash | |
run: | | |
yarn test |