name: PR on: pull_request: branches: [ "*" ] jobs: client-build: name: Client runs-on: ubuntu-latest container: node:16-buster timeout-minutes: 15 defaults: run: working-directory: ./client steps: - name: Checkout code uses: actions/checkout@v2 - name: Installling dependencies run: npm install - name: Lint run: npx eslint --ext .svelte,.js,.ts --ignore-path .gitignore . - name: Formatting run: npx prettier --check --ignore-path .gitignore --plugin-search-dir=. "./**/*.(ts|json|js|svelte)" - name: Build run: npm run build env: VITE_SENTRY_DSN: https://examplePublicKey@o0.ingest.sentry.io/0 VITE_NODE_ENV: development VITE_API_ENDPOINT: https://jokesbapak2.herokuapp.com/v1 - name: Initialize CodeQL uses: github/codeql-action/init@v1 with: languages: javascript - name: Perform CodeQL Analysis uses: github/codeql-action/analyze@v1 api-build: name: API runs-on: ubuntu-latest container: golang:1.17-buster timeout-minutes: 15 services: postgres: image: postgres:13-alpine env: PGDATABASE: jokesbapak2 POSTGRES_DB: jokesbapak2 PGUSER: postgres POSTGRES_USER: postgres PGPASSWORD: password POSTGRES_PASSWORD: password options: >- --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5 ports: - 5432:5432 redis: image: redis:6-alpine ports: - 6379:6379 defaults: run: working-directory: ./api steps: - name: Checkout code uses: actions/checkout@v2 - name: Installling dependencies run: go mod download - name: Build run: go build main.go - name: Run test & coverage run: go test -v -coverprofile=coverage.out -covermode=atomic ./... env: ENV: development PORT: 5000 DATABASE_URL: postgres://postgres:password@postgres:5432/jokesbapak2 REDIS_URL: redis://@redis:6379 - name: Initialize CodeQL uses: github/codeql-action/init@v1 with: languages: go - name: Perform CodeQL Analysis uses: github/codeql-action/analyze@v1 - uses: codecov/codecov-action@v2 with: flags: api