Skip to content

making actionItemCategory name unique for a given Organization #35

making actionItemCategory name unique for a given Organization

making actionItemCategory name unique for a given Organization #35

Workflow file for this run

##############################################################################
##############################################################################
#
# NOTE!
#
# Please read the README.md file in this directory that defines what should
# be placed in this file
#
##############################################################################
##############################################################################
name: Push Workflow
on:
push:
branches:
- '**'
env:
CODECOV_UNIQUE_NAME: CODECOV_UNIQUE_NAME-${{ github.run_id }}-${{ github.run_number }}
jobs:
##############################################################################
# This section is added so that the most recent and valid level of
# code coverage (post PR merge) is reported
##############################################################################
Push-Workflow:
name: Testing Application
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [20.x]
services:
redis:
image: redis:6.0
options: >-
--health-cmd "redis-cli ping"
--health-interval 10s
--health-timeout 5s
--health-retries 10
ports:
- 6379:6379
mongo:
image: mongo:4.4
options: >-
--health-cmd mongo
--health-interval 10s
--health-timeout 5s
--health-retries 10
ports:
- 27017:27017
env:
MONGO_DB_URL: mongodb://localhost:27017/talawa-test-db
REDIS_HOST: localhost
REDIS_PORT: 6379
# ACCESS_TOKEN_SECRET: ${{ secrets.ACCESS_TOKEN_SECRET }}
# REFRESH_TOKEN_SECRET: ${{ secrets.REFRESH_TOKEN_SECRET }}
# We checkout the content of the Talawa-API repository in a directory called `api`
# This is done as we will use the Talawa-Docs repository later too
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Generate Access Token Secret
run: echo "ACCESS_TOKEN_SECRET=$(openssl rand -hex 32)" >> $GITHUB_ENV
- name: Generate Refresh Token Secret
run: echo "REFRESH_TOKEN_SECRET=$(openssl rand -hex 32)" >> $GITHUB_ENV
- name: Set up Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
- name: Install dependencies
run: npm ci
- name: Sleep for 10s
uses: juliangruber/sleep-action@v1
with:
time: 10s
# Testing the application
- name: Run the tests
run: npm run test
# Upload Coverage
- name: Present and upload coverage to Codecov as ${{env.CODECOV_UNIQUE_NAME}}
uses: codecov/codecov-action@v3
with:
directory: api
verbose: true
fail_ci_if_error: false
name: '${{env.CODECOV_UNIQUE_NAME}}'
Generate-Documentation:
name: Generate Documentation
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/develop'
needs: Push-Workflow
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Generate Documentation of HTML pages
run: |
npm install --global typedoc
npm install typedoc-plugin-markdown
npm i --save-dev @types/node
npx typedoc --entryPoints src --out talawa-api-docs --plugin typedoc-plugin-markdown --theme markdown --entryPointStrategy expand
- name: Checking doc updated
id: DocUpdated
run: |
if [ -n "$(git status --porcelain)" ]; then
echo "updateDoc=true" >> $GITHUB_OUTPUT
echo -e "Documentation has been updated!!"
else
Green='0;32'
NoColor='\033[0m'
echo -e "${Green}No documentation updated${NoColor}"
fi
- name: Set env variables
if: steps.DocUpdated.outputs.updateDoc
run: |
echo "commit_id=$(echo $(git rev-parse HEAD))" >> $GITHUB_ENV
echo "email=$(echo $(git log --pretty=format:"%ae" $commit_id))" >> $GITHUB_ENV
- name: Update Doc
if: steps.DocUpdated.outputs.updateDoc
run: |
Green='0;32'
NoColor='\033[0m'
git config --global user.name "${{github.actor}}"
git config --global user.email "${{env.email}}"
git add .
git commit -m "Update documentation"
git push -f https://$GH_TOKEN@github.com/PalisadoesFoundation/talawa-api.git HEAD:develop
echo -e "🚀${Green} Hurrah! doc updated${NoColor}"
env:
ACCESS_TOKEN: ${{ secrets.GH_TOKEN }}
- name: Create Documentation Artifact
uses: actions/upload-artifact@v2
with:
name: documentation-api
path: talawa-api-docs
Copy-docs-to-talawa-docs:
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/develop'
needs: Generate-Documentation
steps:
- uses: actions/checkout@v3
- uses: dmnemec/copy_file_to_another_repo_action@v1.1.1
env:
API_TOKEN_GITHUB: ${{ secrets.API_TOKEN_GITHUB }}
with:
source_file: 'talawa-api-docs/'
destination_repo: 'PalisadoesFoundation/talawa-docs'
destination_branch: 'develop'
destination_folder: 'docs/'
user_email: '${{env.email}}'
user_name: '${{github.actor}}'
commit_message: 'Talawa API docs updated'