From a2289bb745325b0e31c3600a4c33f80ea5715fa2 Mon Sep 17 00:00:00 2001 From: Carina Kothe <69976260+grischperl@users.noreply.github.com> Date: Thu, 14 Dec 2023 16:23:26 +0100 Subject: [PATCH] Setup EPP pipelines (#21) * Linting action * Makrdown linting action * Unit test action --- .github/workflows/lint-markdown-links.yml | 25 ++++++++++--- .github/workflows/lint.yml | 30 +++++++++++++++ .github/workflows/unit-test.yml | 45 +++++++++++++++++++++++ 3 files changed, 95 insertions(+), 5 deletions(-) create mode 100644 .github/workflows/lint.yml create mode 100644 .github/workflows/unit-test.yml diff --git a/.github/workflows/lint-markdown-links.yml b/.github/workflows/lint-markdown-links.yml index d179022..dae5857 100644 --- a/.github/workflows/lint-markdown-links.yml +++ b/.github/workflows/lint-markdown-links.yml @@ -1,14 +1,29 @@ name: Lint Markdown Links -run-name: ${{github.event.pull_request.title}} -on: [ pull_request ] + +on: + pull_request: + branches: + - "main" + - "release-*" + paths-ignore: + - 'docs/**' + - '**.md' + - 'sec-scanners-config.yaml' + jobs: markdown-link-check: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 - - uses: gaurav-nelson/github-action-markdown-link-check@v1 + - name: Checkout repo + uses: actions/checkout@v4 + + - name: Validate links + uses: gaurav-nelson/github-action-markdown-link-check@v1 with: - use-verbose-mode: 'no' + use-quiet-mode: 'yes' + use-verbose-mode: 'yes' config-file: '.mlc.config.json' folder-path: '.' max-depth: -1 + check-modified-files-only: 'yes' + base-branch: ${{ github.base_ref }} diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml new file mode 100644 index 0000000..3ef1c99 --- /dev/null +++ b/.github/workflows/lint.yml @@ -0,0 +1,30 @@ +name: Linting + +on: + pull_request: + branches: + - "main" + - "release-*" + paths-ignore: + - 'docs/**' + - '**.md' + - 'sec-scanners-config.yaml' + +jobs: + linting: + runs-on: ubuntu-latest + steps: + - name: Setup go environment + uses: actions/setup-go@v5 + with: + go-version: '1.21' + cache: false + + - name: Checkout repo + uses: actions/checkout@v4 + + - name: Run linting + uses: golangci/golangci-lint-action@v3 + with: + version: v1.55 + args: --timeout=5m --config=./.golangci.yaml diff --git a/.github/workflows/unit-test.yml b/.github/workflows/unit-test.yml new file mode 100644 index 0000000..da062fc --- /dev/null +++ b/.github/workflows/unit-test.yml @@ -0,0 +1,45 @@ +name: Unit Tests + +env: + KYMA_STABILITY: "unstable" + KYMA: "./hack/kyma" + +on: + push: + branches: + - "main" + - "release-*" + paths-ignore: + - 'docs/**' + - '**.md' + - 'sec-scanners-config.yaml' + pull_request: + branches: + - "main" + - "release-*" + paths-ignore: + - 'docs/**' + - '**.md' + - 'sec-scanners-config.yaml' + +jobs: + unit-tests: + runs-on: ubuntu-latest + steps: + - name: Checkout repo + uses: actions/checkout@v4 + + - name: Setup go environment + uses: actions/setup-go@v5 + with: + go-version: '1.21' + cache: false + + - name: Sync go dependencies + run: | + go mod tidy + go mod vendor + + - name: Run tests + run: | + make test