Merge pull request #365 from hei-school/dev #967
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 | |
on: | |
push: | |
branches: | |
- '*' | |
pull_request: | |
branches: | |
- '*' | |
workflow_dispatch: | |
jobs: | |
tests: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
with: | |
fetch-depth: 0 | |
- name: Setup Node.js | |
uses: actions/setup-node@v2 | |
with: | |
node-version: 17.x | |
- name: Install aws cli | |
uses: unfor19/[email protected] | |
with: | |
version: 2 | |
verbose: false | |
arch: amd64 | |
rootdir: '' | |
workdir: '' | |
- run: sh ./initAWS.sh ${{ secrets.AWS_ACCESS_KEY_ID }} ${{ secrets.AWS_SECRET_ACCESS_KEY_ID }} ${{ secrets.AWS_REGION }} | |
- run: sh ./initNpmrc.sh hei-store npm-hei-school 088312068315 | |
- run: npm config set always-auth true | |
- run: npm install --legacy-peer-deps | |
- name: Cypress dependencies | |
# From: https://docs.cypress.io/guides/getting-started/installing-cypress#System-requirements, Ubuntu section | |
run: | | |
sudo apt-get install libgtk2.0-0 libgtk-3-0 libgbm-dev libnotify-dev libgconf-2-4 libnss3 libxss1 libasound2 libxtst6 xauth xvfb | |
- name: Test | |
run: | | |
export REACT_APP_TEST_STUDENT1_PASSWORD=${{ secrets.TEST_STUDENT1_PASSWORD }} | |
export REACT_APP_TEST_TEACHER1_PASSWORD=${{ secrets.TEST_TEACHER1_PASSWORD }} | |
export REACT_APP_TEST_MANAGER1_PASSWORD=${{ secrets.TEST_MANAGER1_PASSWORD }} | |
npm run test | |
- name: Read version file | |
id: read-version | |
uses: CumulusDS/[email protected] | |
with: | |
file: version.yml | |
version: version | |
- run: npm install --location=global sonar-scanner | |
- name: Sonar | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} | |
run: | | |
sonar-scanner \ | |
-Dsonar.projectVersion=${{ steps.read-version.outputs.version }} \ | |
-Dsonar.branch.name=${GITHUB_REF##*/} | |
style: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Setup Node.js | |
uses: actions/setup-node@v2 | |
with: | |
node-version: 17.x | |
- run: npm install --location=global prettier | |
- run: prettier --check "src/**/*.{js,ts,tsx}" "./**/*.{json,yml,yaml}" |