Merge pull request #3 from Log-Road/feat/getVotePer #31
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: | |
pull_request: | |
branches: | |
- dev | |
- prod | |
push: | |
branches: | |
- dev | |
jobs: | |
ci-build: | |
runs-on: ubuntu-20.04 | |
steps: | |
- name: checkout | |
uses: actions/checkout@v3 | |
- name: Set up Node.js | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 20 | |
- name: install pnpm | |
run: npm i -g pnpm | |
- name: Caching dependencies | |
id: cache | |
uses: actions/cache@v3 | |
with: | |
path: "**/node_modules" | |
key: ${{runner.os}}-node-${{hashFiles('**/pnpm-lock.yml')}} | |
restore-keys: | | |
${{ runner.os }}-node- | |
- name: Install package | |
if: steps.cache.outputs.cache-hit != 'true' | |
run: pnpm i --no-frozen-lockfile | |
- name: env set | |
working-directory: ./ | |
run: | | |
touch .env | |
echo POSTGRESQL_DB=${{secrets.POSTGRESQL_DB}} >> .env | |
echo PORT=${{secrets.PORT}} >> .env | |
echo ORIGIN=${{secrets.ORIGIN}} >> .env | |
echo TESTING_TOKEN=${{secrets.TESTING_TOKEN}} >> .env | |
echo TESTING_PASSWORD=${{secrets.TESTING_PASSWORD}} >> .env | |
- name: prisma set | |
run: | | |
npx prisma generate --schema=src/prisma/schema.prisma | |
- name: Test unit | |
run: pnpm test:unit | |
# - name: Test E2E | |
# run: pnpm test:e2e | |
- name: test | |
run: | | |
timeout ${{vars.SLEEP}} nohup pnpm start > app.log || code=$?; if [[ $code -ne 124 && $code -ne 0 ]]; then exit $code; fi | |
cat app.log |