From 2b383097055e2ec9e8886c34cb7467c65f0fcef9 Mon Sep 17 00:00:00 2001 From: Matous Jobanek Date: Fri, 22 Mar 2024 11:27:54 +0100 Subject: [PATCH] split workflow.yml (#23) --- .github/workflows/linters.yml | 46 +++++++++++++++++++ .../{workflow.yml => test-with-coverage.yml} | 41 ++--------------- 2 files changed, 51 insertions(+), 36 deletions(-) create mode 100644 .github/workflows/linters.yml rename .github/workflows/{workflow.yml => test-with-coverage.yml} (61%) diff --git a/.github/workflows/linters.yml b/.github/workflows/linters.yml new file mode 100644 index 0000000..7e7689e --- /dev/null +++ b/.github/workflows/linters.yml @@ -0,0 +1,46 @@ +name: ci-build +on: + push: + branches: + - master + tags-ignore: + - '*.*' + pull_request: + branches: + - master + +jobs: + golangci: + name: GolangCI Lint + runs-on: ubuntu-latest + + steps: + - name: Install Go + uses: actions/setup-go@v5 + with: + go-version: 1.20.x + + - name: Checkout code + uses: actions/checkout@v4 + + - name: Lint + uses: golangci/golangci-lint-action@v4 + with: + version: v1.56.2 + skip-pkg-cache: true + skip-build-cache: true + args: --config=./.golangci.yml --verbose + + yammlint: + name: YAML Lint + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Install yamllint + run: pip install yamllint + + - name: Lint YAML files + run: yamllint -c .yamllint ./ diff --git a/.github/workflows/workflow.yml b/.github/workflows/test-with-coverage.yml similarity index 61% rename from .github/workflows/workflow.yml rename to .github/workflows/test-with-coverage.yml index b4b1055..b23d103 100644 --- a/.github/workflows/workflow.yml +++ b/.github/workflows/test-with-coverage.yml @@ -16,7 +16,7 @@ jobs: strategy: matrix: os: [ ubuntu-latest ] - name: Test-with-Coverage + name: Test with coverage steps: - name: Install Go @@ -26,6 +26,10 @@ jobs: - name: Checkout code uses: actions/checkout@v4 + with: + ref: ${{github.event.pull_request.head.ref}} + repository: ${{github.event.pull_request.head.repo.full_name}} + fetch-depth: 0 - name: Cache dependencies uses: actions/cache@v4 @@ -50,38 +54,3 @@ jobs: flags: unittests # optional fail_ci_if_error: true # optional (default = false) verbose: true # optional (default = false) - - golangci: - name: GolangCI Lint - runs-on: ubuntu-latest - - steps: - - name: Install Go - uses: actions/setup-go@v5 - with: - go-version: 1.20.x - - - name: Checkout code - uses: actions/checkout@v4 - - - name: Lint - uses: golangci/golangci-lint-action@v4 - with: - version: v1.56.2 - skip-pkg-cache: true - skip-build-cache: true - args: --config=./.golangci.yml --verbose - - yammlint: - name: YAML Lint - runs-on: ubuntu-latest - - steps: - - name: Checkout code - uses: actions/checkout@v4 - - - name: Install yamllint - run: pip install yamllint - - - name: Lint YAML files - run: yamllint -c .yamllint ./