|
| 1 | +name: Continous Integration |
| 2 | +on: |
| 3 | + push: |
| 4 | + branches: [master] |
| 5 | + pull_request: |
| 6 | + # The branches below must be a subset of the branches above |
| 7 | + branches: [master] |
| 8 | + |
| 9 | +env: |
| 10 | + CI: true |
| 11 | + |
| 12 | +jobs: |
| 13 | + build: |
| 14 | + runs-on: ubuntu-18.04 |
| 15 | + strategy: |
| 16 | + matrix: |
| 17 | + # See supported Node.js release schedule at https://nodejs.org/en/about/releases/ |
| 18 | + node-version: [12, 14, 16] |
| 19 | + steps: |
| 20 | + - uses: actions/checkout@v2 |
| 21 | + - name: Use Node.js ${{ matrix.node-version }} |
| 22 | + uses: actions/setup-node@v2 |
| 23 | + with: |
| 24 | + node-version: ${{ matrix.node-version }} |
| 25 | + - uses: ankane/setup-mysql@v1 |
| 26 | + with: |
| 27 | + mysql-version: 5.7 |
| 28 | + - run: | |
| 29 | + sudo mysql -e "CREATE USER '${{ secrets.MYSQL_USER }}'@'localhost' IDENTIFIED BY '${{ secrets.MYSQL_PASSWORD }}'" |
| 30 | + sudo mysql -u root -e "GRANT ALL PRIVILEGES ON *.* TO '${{ secrets.MYSQL_USER }}'@'localhost'" |
| 31 | + sudo mysql -u root -e "ALTER USER '${{ secrets.MYSQL_USER }}'@'localhost' IDENTIFIED WITH mysql_native_password by '${{ secrets.MYSQL_PASSWORD }}'" |
| 32 | + sudo mysql -u root -e "FLUSH PRIVILEGES" |
| 33 | + - run: npm install |
| 34 | + - run: npm test |
| 35 | + env: |
| 36 | + MYSQL_USER: ${{ secrets.MYSQL_USER }} |
| 37 | + MYSQL_PASSWORD: ${{ secrets.MYSQL_PASSWORD }} |
| 38 | + CI: true |
| 39 | + code-lint: |
| 40 | + name: Code Lint |
| 41 | + runs-on: ubuntu-latest |
| 42 | + timeout-minutes: 60 |
| 43 | + steps: |
| 44 | + - uses: actions/checkout@v2 |
| 45 | + - name: Use Node.js 14 |
| 46 | + uses: actions/setup-node@v2 |
| 47 | + with: |
| 48 | + node-version: 14 |
| 49 | + - name: Bootstrap project |
| 50 | + run: | |
| 51 | + npm ci --ignore-scripts |
| 52 | + - name: Verify code linting |
| 53 | + run: npm run lint |
| 54 | + |
| 55 | + commit-lint: |
| 56 | + name: Commit Lint |
| 57 | + runs-on: ubuntu-latest |
| 58 | + timeout-minutes: 60 |
| 59 | + steps: |
| 60 | + - uses: actions/checkout@v2 |
| 61 | + with: |
| 62 | + fetch-depth: 0 |
| 63 | + - name: Use Node.js 14 |
| 64 | + uses: actions/setup-node@v2 |
| 65 | + with: |
| 66 | + node-version: 14 |
| 67 | + - name: Bootstrap project |
| 68 | + run: | |
| 69 | + npm ci --ignore-scripts |
| 70 | + - name: Verify commit linting |
| 71 | + run: npx commitlint --from origin/master --to HEAD --verbose |
0 commit comments