diff --git a/.github/workflows/api-testing.yml b/.github/workflows/api-testing.yml new file mode 100644 index 0000000..50c79fe --- /dev/null +++ b/.github/workflows/api-testing.yml @@ -0,0 +1,60 @@ +name: CI Testing (API) + +on: + pull_request: + paths: + - "api/**" + push: + paths: + - "api/**" + tags-ignore: + - "*" + +jobs: + test: + runs-on: ubuntu-latest + + services: + postgres: + image: postgres + env: + POSTGRES_USERNAME: nextnet + POSTGRES_PASSWORD: nextnet + POSTGRES_DB: nextnet + options: >- + --health-cmd pg_isready + --health-interval 10s + --health-timeout 5s + --health-retries 5 + ports: + - 5432:5432 + + steps: + - name: Checkout code using Git + uses: actions/checkout@main + + - name: Install Node + uses: actions/setup-node@v4 + with: + node-version: 20.x + + - name: Install dependencies + working-directory: api + run: npm install --save-dev + + - name: Install prisma + working-directory: api + run: npx prisma migrate dev + + - name: Build source + working-directory: api + run: npm build + + - name: Run eslint + working-directory: api + run: npx eslint src + + - name: Run prettier to verify if we're formatted or not + uses: creyD/prettier_action@v4.3 + with: + dry: true \ No newline at end of file diff --git a/.github/workflows/lom-testing.yml b/.github/workflows/lom-testing.yml new file mode 100644 index 0000000..8d911f0 --- /dev/null +++ b/.github/workflows/lom-testing.yml @@ -0,0 +1,60 @@ +name: CI Testing (LOM) + +on: + pull_request: + paths: + - "api/**" + push: + paths: + - "api/**" + tags-ignore: + - "*" + +jobs: + test: + runs-on: ubuntu-latest + + services: + postgres: + image: postgres + env: + POSTGRES_USERNAME: nextnet + POSTGRES_PASSWORD: nextnet + POSTGRES_DB: nextnet + options: >- + --health-cmd pg_isready + --health-interval 10s + --health-timeout 5s + --health-retries 5 + ports: + - 5432:5432 + + steps: + - name: Checkout code using Git + uses: actions/checkout@main + + - name: Install Node + uses: actions/setup-node@v4 + with: + node-version: 20.x + + - name: Install dependencies + working-directory: api + run: npm install --save-dev + + - name: Install prisma + working-directory: api + run: npx prisma migrate dev + + - name: Build source + working-directory: api + run: npm build + + - name: Run eslint + working-directory: api + run: npx eslint src + + - name: Run prettier to verify if we're formatted or not + uses: creyD/prettier_action@v4.3 + with: + dry: true \ No newline at end of file