From cff403097bea6f42f4d62ed35703628047b77657 Mon Sep 17 00:00:00 2001 From: Maarten de Kruijf Date: Wed, 6 Mar 2024 13:15:21 +0100 Subject: [PATCH] Moved build lint test to ci.yml --- .github/workflows/build.yml | 23 -------------- .github/workflows/ci.yml | 63 +++++++++++++++++++++++++++++++++++++ .github/workflows/lint.yml | 27 ---------------- .github/workflows/test.yml | 27 ---------------- 4 files changed, 63 insertions(+), 77 deletions(-) delete mode 100644 .github/workflows/build.yml create mode 100644 .github/workflows/ci.yml delete mode 100644 .github/workflows/lint.yml delete mode 100644 .github/workflows/test.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml deleted file mode 100644 index c318d6bf..00000000 --- a/.github/workflows/build.yml +++ /dev/null @@ -1,23 +0,0 @@ -name: Build - -on: - pull_request: - branches: [ master, development ] - -jobs: - build: - name: Build binary - runs-on: ubuntu-latest - container: - image: golangci/golangci-lint:latest - steps: - - name: Checkout Code - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - - name: Install swaggo - run: go install github.com/swaggo/swag/cmd/swag@latest - - - name: Build with make - run: make build diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 00000000..b9d8b76b --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,63 @@ +name: Ci + +on: + pull_request: + branches: [ master, development ] + +jobs: + build: + name: Build binary + runs-on: ubuntu-latest + container: + image: golangci/golangci-lint:latest + steps: + - name: Checkout Code + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Install swaggo + run: go install github.com/swaggo/swag/cmd/swag@latest + + - name: Build with make + run: make build + + lint: + name: Lint go code with golangci + runs-on: ubuntu-latest + container: + image: golangci/golangci-lint:latest + steps: + - name: Checkout Code + uses: actions/checkout@v4 + with: + fetch-depth: 0 + - name: Make repo safe + run: git config --global --add safe.directory /__w/SOARCA/SOARCA + + - name: lint + run: | + ls -la + golangci-lint run --timeout 5m -v + shell: bash + + test: + name: Run ci-tests + runs-on: ubuntu-latest + container: + image: golang:latest + steps: + - name: Checkout Code + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Run tests + run: | + apt update + apt install openssh-server -y + useradd sshtest + echo "sshtest:pdKY77qNxpI5MAizirtjCVOcm0KFKIs" | chpasswd + service ssh start + make ci-test + diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml deleted file mode 100644 index 8027f336..00000000 --- a/.github/workflows/lint.yml +++ /dev/null @@ -1,27 +0,0 @@ -name: Lint - -on: - pull_request: - branches: [ master, development ] - -jobs: - build: - name: Lint go code with golangci - runs-on: ubuntu-latest - container: - image: golangci/golangci-lint:latest - steps: - - name: Checkout Code - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - name: Make repo safe - run: git config --global --add safe.directory /__w/SOARCA/SOARCA - - - name: lint - run: | - ls -la - golangci-lint run --timeout 5m -v - shell: bash - - diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml deleted file mode 100644 index 29a23153..00000000 --- a/.github/workflows/test.yml +++ /dev/null @@ -1,27 +0,0 @@ -name: Test - -on: - pull_request: - branches: [ master, development ] - -jobs: - test: - name: Run ci-tests - runs-on: ubuntu-latest - container: - image: golang:latest - steps: - - name: Checkout Code - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - - name: Run tests - run: | - apt update - apt install openssh-server -y - useradd sshtest - echo "sshtest:pdKY77qNxpI5MAizirtjCVOcm0KFKIs" | chpasswd - service ssh start - make ci-test -