name: CI

on:
  push:
    branches:
      - main
  pull_request:
    branches:
      - main

jobs:
  build:
    runs-on: ubuntu-latest
    env:
      GO111MODULE: on

    steps:
      - name: Checkout code
        uses: actions/checkout@v3

      - name: Set up Go
        uses: actions/setup-go@v5
        with:
          go-version: 1.23

      - name: Install dependencies
        run: |
          go mod download

      - name: Lint code
        run: |
          go install github.com/golangci/golangci-lint/cmd/golangci-lint@latest
          golangci-lint run

      - name: Run tests
        run: |
          go test ./...

      # - name: Run Gosec Security Scanner
      #   uses: securego/gosec@master
      #   with:
      #     args: ./...

      - name: Build Docker image
        run: |
          docker build -t rentease .
