From 4e055a014273ac87a4050ead5002d81bc8b4363b Mon Sep 17 00:00:00 2001 From: Akis Maziotis Date: Thu, 26 Oct 2023 17:35:57 +0300 Subject: [PATCH] [feat] refactor CI Signed-off-by: Akis Maziotis --- .github/workflows/build.yml | 38 ----------------------------- .github/workflows/ci.yml | 38 +++++++++++++++++++++++++++++ .github/workflows/golangci-lint.yml | 25 ------------------- .github/workflows/test.yml | 37 ---------------------------- 4 files changed, 38 insertions(+), 100 deletions(-) delete mode 100644 .github/workflows/build.yml create mode 100644 .github/workflows/ci.yml delete mode 100644 .github/workflows/golangci-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 8ecf356..0000000 --- a/.github/workflows/build.yml +++ /dev/null @@ -1,38 +0,0 @@ -name: Build - -on: - push: - branches: - - master - pull_request: - -permissions: - contents: read - -jobs: - build: - runs-on: ubuntu-latest - - steps: - - name: Checkout code - uses: actions/checkout@v4 - - - name: Install Go - uses: actions/setup-go@v4 - with: - go-version: 1.20.7 - - - name: check dependencies - run: make check-deps - - - name: Run build - run: make package - - - name: Archive production artifacts - uses: actions/upload-artifact@v2 - with: - name: push-proxy-binaries - retention-days: 5 - path: | - ./dist/*.tar.gz - ./dist/checksums.txt diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..bf13527 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,38 @@ +name: Build and Test + +on: + push: + branches: + - master + pull_request: +permissions: + contents: read + +jobs: + lint: + name: Lint + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0 + - name: Lint + run: make lint + test: + name: Test + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0 + - name: Test + run: make test + build: + name: Build + runs-on: ubuntu-latest + needs: [lint,test] + steps: + - name: Checkout code + uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0 + - name: Build + run: make build + - name: Make Clean + run: make clean \ No newline at end of file diff --git a/.github/workflows/golangci-lint.yml b/.github/workflows/golangci-lint.yml deleted file mode 100644 index 583a607..0000000 --- a/.github/workflows/golangci-lint.yml +++ /dev/null @@ -1,25 +0,0 @@ -name: golangci-lint - -on: - push: - branches: - - master - pull_request: - -permissions: - contents: read - -jobs: - golangci: - name: lint - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - name: Install Go - uses: actions/setup-go@v4 - with: - go-version: 1.20.7 - - name: golangci-lint - uses: golangci/golangci-lint-action@v3 - with: - version: v1.52.2 diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml deleted file mode 100644 index 3c52cf3..0000000 --- a/.github/workflows/test.yml +++ /dev/null @@ -1,37 +0,0 @@ -name: Test - -on: - push: - branches: - - master - pull_request: - -permissions: - contents: read - checks: write - pull-requests: write - -jobs: - test: - runs-on: ubuntu-latest - - steps: - - name: Checkout code - uses: actions/checkout@v4 - - - name: Install Go - uses: actions/setup-go@v4 - with: - go-version: 1.20.7 - - - name: Run tests - run: | - go install gotest.tools/gotestsum@latest - mkdir -p test-reports - gotestsum --junitfile test-reports/unit-tests.xml - - - name: Publish Unit Test Results - uses: EnricoMi/publish-unit-test-result-action@v1 - if: always() - with: - files: test-reports/unit-tests.xml