From 432548af6e992eb77b908eda17b00bb79f6a7ec6 Mon Sep 17 00:00:00 2001 From: Anthony TREUILLIER Date: Wed, 29 Oct 2025 16:35:32 +0100 Subject: [PATCH] ci: Add github actions Signed-off-by: Anthony TREUILLIER --- .github/CODEOWNERS | 1 + .github/workflows/pre-merge.yaml | 27 +++++++++++++++++++++++++++ .github/workflows/test.yaml | 19 +++++++++++++++++++ 3 files changed, 47 insertions(+) create mode 100644 .github/CODEOWNERS create mode 100644 .github/workflows/pre-merge.yaml create mode 100644 .github/workflows/test.yaml diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS new file mode 100644 index 0000000..03d3be6 --- /dev/null +++ b/.github/CODEOWNERS @@ -0,0 +1 @@ +* @scality/metalk8s diff --git a/.github/workflows/pre-merge.yaml b/.github/workflows/pre-merge.yaml new file mode 100644 index 0000000..15298fb --- /dev/null +++ b/.github/workflows/pre-merge.yaml @@ -0,0 +1,27 @@ +name: "Pre Merge" + +on: + workflow_dispatch: + + pull_request: + branches: + - main + +jobs: + lint: + runs-on: ubuntu-24.04 + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Set up Go + uses: actions/setup-go@v6 + with: + go-version-file: 'go.mod' + - name: Run linters + uses: golangci/golangci-lint-action@v8 + with: + version: v2.5.0 + + test: + uses: ./.github/workflows/test.yaml + secrets: inherit diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml new file mode 100644 index 0000000..30a243a --- /dev/null +++ b/.github/workflows/test.yaml @@ -0,0 +1,19 @@ +name: Tests + +on: + workflow_call: + +jobs: + test: + name: Run on Ubuntu + runs-on: ubuntu-latest + steps: + - name: Clone the code + uses: actions/checkout@v4 + - name: Set up Go + uses: actions/setup-go@v6 + with: + go-version-file: 'go.mod' + - name: Running Tests + run: | + go test -v -race ./...