Add testing for user service #68
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 | |
on: | |
push: | |
branches: | |
- "*" | |
pull_request: | |
branches: | |
- "*" | |
env: | |
NODE_VERSION: 20 | |
permissions: | |
contents: read | |
jobs: | |
ci: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
service: [frontend, backend/question-service, backend/user-service] | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Setting node version | |
uses: actions/setup-node@v4 | |
with: | |
node-version: ${{ env.NODE_VERSION }} | |
- name: Install dependencies | |
working-directory: ${{ matrix.service }} | |
run: npm install | |
- name: Linting | |
working-directory: ${{ matrix.service }} | |
run: npm run lint | |
- name: 'Create env file' | |
run: | | |
touch .env | |
echo TEST_VAR=blah >> .env | |
echo FIREBASE_PROJECT_ID="https://xxx.execute-api.us-west-2.amazonaws.com" >> .env | |
echo API_KEY=${{ secrets.FIREBASE_PRIVATE_KEY }} >> .env | |
echo API_KEY2=${{ env.FIREBASE_PRIVATE_KEY }} >> .env | |
echo API_KEY4=${{ vars.FIREBASE_PRIVATE_KEY }} >> .env | |
cat .env | |
- name: Tests | |
working-directory: ${{ matrix.service }} | |
env: | |
CI: true | |
FIREBASE_PROJECT_ID: test | |
FIREBASE_PRIVATE_KEY: ${{ secrets.FIREBASE_PRIVATE_KEY }} | |
FIREBASE_CLIENT_EMAIL: ${{ secrets.FIREBASE_CLIENT_EMAIL }} | |
FIREBASE_DATABASE_URL: ${{ secrets.FIREBASE_DATABASE_URL }} | |
FIREBASE_TEST: blah | |
run: npm test |