Skip to content

Commit

Permalink
Fixed issue: Split github actions in two pieces (Frontend) (#2265)
Browse files Browse the repository at this point in the history
* Fixed issue: Split github actions in two pieces (Frontend)

* Dev: Fixed missing pipe in frontend workflow

* Dev: Added node version to step

* Dev: Added strategy with nodejs-version in matrix

* Dev: Added node into cache

* Dev: Removed step and combined it with another

* Dev: Removed step and added two smaller ones

* Dev: Removed step and added two smaller ones

* Dev: Removed stuff

* Dev: Added debug step

* Dev: added ls github workspace

* Dev: Added cd step to job

* Dev: Added cd step to job

* Dev: Added steps

* Dev: Added debugging step

* Dev: Debug

* Dev: Removed unneccessary step and added it to another

* Dev: Removed node-sass and added sass from/to adminbasics

* Dev: Build new version of adminbasics assets

* Dev: Updated rollup-plugin-scss to the latest version

* Dev: Build new adminbasics assets version

* Dev: Removed debug step and fixed testing step

* Dev: Fixed testing step

* Dev: Fixed testing step 2

* Dev: Fixed testing step 3

* Dev: Removed all JS test steps from main.yml

* Dev: Added new line

* Dev: WIP

* Dev: Removed pipe from command - cause its a one liner

* Dev: Added missing env variable

* Dev: Restored previous function tests step
  • Loading branch information
thedirtypanda committed Mar 1, 2022
1 parent 5896566 commit 600ff00
Show file tree
Hide file tree
Showing 8 changed files with 808 additions and 1,385 deletions.
81 changes: 81 additions & 0 deletions .github/workflows/frontend.yml
@@ -0,0 +1,81 @@
# This workflow will prepare and test the frontend

name: LimeSurvey - Frontend - CI pipeline

# Triggers the workflow on push or pull request events on all branches
on:
pull_request:
push:
branches:
- '*'
- '**'
- 'dev/**'
- 'bug/**'
- 'feature/**'
- 'zoho/**'

jobs:
job_build_packages:
runs-on: ubuntu-18.04 # ubuntu runner hosted by Github
strategy:
matrix:
# Specify what version of nodejs you want to test
nodeJS-versions: ['10.16.3']
name: Build Frontend Packages
steps:
- name: Checkout the code
uses: actions/checkout@v2

- name: Prepare nvm with Node ${{ matrix.nodeJS-versions }}
run: |
# Update
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.38.0/install.sh | bash
source ~/.nvm/nvm.sh
# Install Node.js
nvm install ${{ matrix.nodeJS-versions }}
nvm use ${{ matrix.nodeJS-versions }}
- name: Install adminbasics
run: |
cd ${{ github.workspace }}
yarn --cwd ./assets/packages/adminbasics
- name: Build adminbasics
run: |
cd ${{ github.workspace }}
yarn --cwd ./assets/packages/adminbasics build
job_run_tests:
needs: [job_build_packages]
runs-on: ubuntu-18.04 # ubuntu runner hosted by Github
strategy:
matrix:
# Specify what version of nodejs you want to test
nodeJS-versions: ['10.16.3']
name: Run Frontend Tests
steps:
- name: Checkout the code
uses: actions/checkout@v2

- name: Prepare nvm with Node ${{ matrix.nodeJS-versions }}
run: |
# Update
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.38.0/install.sh | bash
source ~/.nvm/nvm.sh
# Install Node.js
nvm install ${{ matrix.nodeJS-versions }}
nvm use ${{ matrix.nodeJS-versions }}
- name: Install adminbasics
run: |
cd ${{ github.workspace }}
yarn --cwd ./assets/packages/adminbasics
- name: Run Tests
run: |
cd ${{ github.workspace }}
yarn --cwd ./assets/packages/adminbasics run test

16 changes: 0 additions & 16 deletions .github/workflows/main.yml
Expand Up @@ -18,7 +18,6 @@ jobs:
matrix:
# Specify what versions of php you want to test
php-versions: ['7.2', '8.0']
nodeJS-versions: [ '10.16.3' ]
# Env vars for this job
env:
DBENGINE: INNODB
Expand Down Expand Up @@ -141,18 +140,3 @@ jobs:
env:
DOMAIN: localhost
run: php third_party/bin/phpunit --testdox --stop-on-failure tests/functional

# Prepare the packages that need to be tested and update the nvm
- name: Prepare the nvm with Node ${{ matrix.nodeJS-versions }}
run: |
# Update
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.38.0/install.sh | bash
source ~/.nvm/nvm.sh
# Install Node.js
nvm install ${{ matrix.nodeJS-versions }}
nvm use ${{ matrix.nodeJS-versions }}
node ./buildVueComponents.js -s adminbasics -p
- name: Run JS tests
run: yarn --cwd ./assets/packages/adminbasics run test

0 comments on commit 600ff00

Please sign in to comment.