workflow: fix build-test.yml #212
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: Build️ And Test 🏗🧪 | ||
on: | ||
push: | ||
branches: [ main ] | ||
pull_request: | ||
branches: [ main ] | ||
permissions: | ||
contents: read | ||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 | ||
with: | ||
fetch-depth: 0 | ||
- name: Set up Go | ||
uses: actions/setup-go@f111f3307d8850f501ac008e886eec1fd1932a34 | ||
with: | ||
go-version: 1.18 | ||
- name: Install dependencies | ||
run: | | ||
if grep -q "require" go.mod; then | ||
echo "Dependencies found, installing..." | ||
go get . | ||
else | ||
echo "No dependencies found, skipping dependency installation." | ||
fi | ||
- name: golangci-lint | ||
uses: golangci/golangci-lint-action@e60da84bfae8c7920a47be973d75e15710aa8bd7 | ||
with: | ||
version: v1.57.2 | ||
args: -c .golangci.yml --timeout=2m -v | ||
- name: Build | ||
run: go build -v ./... | ||
- name: Test | ||
run: go test ./es/... -v -race -coverprofile=coverage.txt -covermode=atomic | ||
- name: Upload coverage reports to Codecov | ||
uses: codecov/codecov-action@13ce06bfc6bbe3ecf90edbbf1bc32fe5978ca1d3 | ||
with: | ||
token: ${{ secrets.CODECOV_TOKEN }} | ||
slug: Trendyol/es-query-builder | ||
security-gates: | ||
if: false # temporary disabled | ||
uses: ./.github/workflows/security-gates.yml | ||
Check failure on line 55 in .github/workflows/build-test.yml
|
||
needs: build | ||
permissions: | ||
actions: read | ||
contents: read | ||
security-events: write |