Fixed generated code and added gorm model file #51
This file contains hidden or 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: ReFuel CI | |
| on: | |
| push: | |
| branches: [main, develop] | |
| pull_request: | |
| branches: [main, develop] | |
| jobs: | |
| frontend-checks: | |
| runs-on: ubuntu-latest | |
| defaults: | |
| run: | |
| working-directory: ./frontend | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: "18" | |
| cache: "npm" | |
| cache-dependency-path: frontend/package-lock.json | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Lint | |
| run: npm run lint | |
| - name: Test | |
| run: npm run test -- --coverage --watchAll=false # watchAll=false for CI | |
| # - name: Build (Optional: check if build succeeds) | |
| # run: npm run build | |
| backend-checks: | |
| runs-on: ubuntu-latest | |
| defaults: | |
| run: | |
| working-directory: ./backend | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Go | |
| uses: actions/setup-go@v5 | |
| with: | |
| go-version: "1.21" | |
| - name: Install golangci-lint | |
| run: | | |
| curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.55.2 # Specify a stable version | |
| echo "$(go env GOPATH)/bin" >> $GITHUB_PATH | |
| # golang-migrate is usually not run directly in CI unless you have specific test migration steps | |
| # - name: Install golang-migrate | |
| # run: | | |
| # go install -tags 'mysql' github.com/golang-migrate/migrate/v4/cmd/migrate@latest | |
| # echo "$(go env GOPATH)/bin" >> $GITHUB_PATH | |
| - name: Go Tidy | |
| run: go mod tidy | |
| - name: Vet | |
| run: go vet ./... | |
| - name: Lint | |
| run: golangci-lint run ./... --timeout 5m | |
| - name: Test with Coverage | |
| run: go test -v -coverprofile=coverage.out ./... | |
| # - name: Build (Optional: check if build succeeds) | |
| # run: go build -v -o /dev/null ./... |