8.0.0 GitHub action #12
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
name: CI/CD | |
on: | |
push: | |
branches: | |
- release-8.0.0 | |
pull_request: | |
branches: | |
- release-8.0.0 | |
jobs: | |
build-and-test: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Set up Node.js | |
uses: actions/setup-node@v3 | |
with: | |
node-version: '18.20.2' | |
- name: Install yarn | |
run: npm install -g yarn | |
- name: Clean and install client dependencies | |
run: | | |
cd src/app/client | |
yarn cache clean | |
yarn install --no-progress --production=true | |
- name: Build client | |
run: npm run build | |
working-directory: src/app/client | |
- name: Prepare server directory | |
run: | | |
mkdir -p $GITHUB_WORKSPACE/app_dist | |
cp -r src/app/libs src/app/helpers src/app/proxy src/app/resourcebundles src/app/package.json src/app/framework.config.js src/app/sunbird-plugins src/app/routes src/app/constants src/app/controllers src/app/server.js $GITHUB_WORKSPACE/app_dist/ | |
- name: Install server dependencies | |
run: yarn install --ignore-engines --no-progress --production=true | |
working-directory: ${{ github.workspace }}/app_dist | |
- name: Build and run server scripts | |
run: | | |
mv dist/index.html dist/index.ejs | |
node helpers/resourceBundles/build.js -task="phraseAppPull" | |
working-directory: ${{ github.workspace }}/app_dist | |
- name: Run tests | |
run: npm run test:ci | |
working-directory: src/app/client | |
- name: Install Sonar Scanner | |
run: | | |
cd /tmp | |
wget https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-5.0.1.3006-linux.zip | |
unzip sonar-scanner-cli-5.0.1.3006-linux.zip | |
cd - | |
- name: Run Sonar Scanner | |
run: /tmp/sonar-scanner-5.0.1.3006-linux/bin/sonar-scanner | |
working-directory: ${{ github.workspace }} |