Merge pull request #57 from ReliefApplications/feat/HIT-347-Kobo-Defi… #6
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: | |
- main | |
- next | |
- next-major | |
- beta | |
- alpha | |
pull_request: | |
branches: | |
- main | |
- next | |
- next-major | |
- beta | |
- alpha | |
- "[0-9]*.[0-9x]*.x" | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
jobs: | |
build: | |
name: Test | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
node-version: [16.x] | |
mongodb-version: [4.2] | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Use Node.js ${{ matrix.node-version }} | |
uses: actions/setup-node@v3 | |
with: | |
node-version: ${{ matrix.node-version }} | |
- name: Cache node modules | |
uses: actions/cache@v1 | |
with: | |
path: node_modules | |
key: ${{ runner.OS }}-build-${{ hashFiles('**/package-lock.json') }} | |
restore-keys: | | |
${{ runner.OS }}-build-${{ env.cache-name }}- | |
${{ runner.OS }}-build- | |
${{ runner.OS }}- | |
#- name: Start MongoDB ${{ matrix.mongodb-version }} | |
# uses: supercharge/[email protected] | |
# with: | |
# mongodb-version: ${{ matrix.mongodb-version }} | |
# mongodb-db: test | |
- name: Install Dependencies | |
run: npm ci | |
# - name: Create .env file | |
# run: | | |
# touch .env | |
# echo '${{ secrets.ENV_TEST }}' >> .env | |
# - name: Archive ENV file | |
# uses: actions/upload-artifact@v3 | |
# with: | |
# name: env | |
# path: .env | |
- name: Test | |
#run: npm run test | |
run: docker-compose -f docker-compose.test.yml run test-server npm run test | |
- name: Archive code coverage result | |
if: success() | |
uses: actions/upload-artifact@v3 | |
with: | |
name: deploy_coverage | |
path: coverage |