diff --git a/.github/workflows/e2e.yml b/.github/workflows/e2e.yml new file mode 100644 index 0000000..d1bbf7a --- /dev/null +++ b/.github/workflows/e2e.yml @@ -0,0 +1,43 @@ +name: End-To-End Test + +on: + push: + branches: [ "main" ] + pull_request: + branches: [ "main" ] + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version: 18.17.0 + + - name: Setup Go + uses: actions/setup-go@v5 + with: + go-version: '^1.22.3' + + - name: Run docker-compose + uses: hoverkraft-tech/compose-action@v2.0.1 + with: + compose-file: './docker-compose.yml' + + - run: npm ci + + - run: prisma generate + - run: make db push + - run: make seed + + - run: npm run build + + - run: make dev api + - run: npm start + + - run: npm run e2e + \ No newline at end of file diff --git a/.github/workflows/unit-tests.yml b/.github/workflows/unit-tests.yml new file mode 100644 index 0000000..cb53103 --- /dev/null +++ b/.github/workflows/unit-tests.yml @@ -0,0 +1,34 @@ +name: Unit Tests + +on: + push: + branches: [ "main" ] + pull_request: + branches: [ "main" ] + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version: 18.17.0 + + - name: Setup Go + uses: actions/setup-go@v5 + with: + go-version: '^1.22.3' + + - run: npm ci + + - run: npm run build + + - run: make dev api + - run: npm start + + - run: npm test + \ No newline at end of file diff --git a/Makefile b/Makefile index 9d68a52..aecac32 100644 --- a/Makefile +++ b/Makefile @@ -8,4 +8,4 @@ db push: npx prisma db push dev api: - go run . + go run api.dev.go