diff --git a/.drone.yml b/.drone.yml deleted file mode 100644 index e648c5f2..00000000 --- a/.drone.yml +++ /dev/null @@ -1,37 +0,0 @@ ---- -kind: pipeline -type: docker -name: amd64 - -platform: - os: linux - arch: amd64 - -steps: - - name: test - image: registry.suse.com/bci/golang:1.20 - commands: - - go install github.com/golang/mock/mockgen@v1.6.0 - - ./scripts/ci - volumes: - - name: docker - path: /var/run/docker.sock - ---- -kind: pipeline -type: docker -name: arm64 - -platform: - os: linux - arch: arm64 - -steps: - - name: test - image: registry.suse.com/bci/golang:1.20 - commands: - - go install github.com/golang/mock/mockgen@v1.6.0 - - ./scripts/ci - volumes: - - name: docker - path: /var/run/docker.sock diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml new file mode 100644 index 00000000..f6a935dc --- /dev/null +++ b/.github/workflows/ci.yaml @@ -0,0 +1,32 @@ +name: ci + +on: + push: + pull_request: + tags: + - v* + branches: + - 'release/*' + - 'master' + +jobs: + ci: + strategy: + matrix: + arch : [ amd64,arm64 ] + runs-on : ["org--${{ github.repository_owner }}--${{ matrix.arch }}-containers"] + container: ghcr.io/catthehacker/ubuntu:act-22.04 + steps: + - name : Checkout repository + # https://github.com/actions/checkout/releases/tag/v4.1.1 + uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 + - name: Install Go + # https://github.com/actions/setup-go/releases/tag/v5.0.0 + uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 # v5.0.0 + with: + go-version-file: 'go.mod' + - name : Install mockgen + run: go install github.com/golang/mock/mockgen@v1.6.0 + - name : Run CI + run: bash scripts/ci + diff --git a/.github/workflows/lint.yaml b/.github/workflows/lint.yaml index e820faa5..9f53dd95 100644 --- a/.github/workflows/lint.yaml +++ b/.github/workflows/lint.yaml @@ -1,7 +1,4 @@ -name: golangci-lint - -env: - SETUP_GO_VERSION: '^1.20' +name: golint on: push: @@ -14,25 +11,28 @@ on: jobs: golangci: - name: golangci-lint + name: lint runs-on: ubuntu-latest steps: - - name: Checkout - uses: actions/checkout@v4 - with: - submodules: recursive + - name: Checkout + # https://github.com/actions/checkout/releases/tag/v4.1.1 + uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 + with: + submodules: recursive - - name: Setup Go - uses: actions/setup-go@v5 - with: - go-version: ${{ env.SETUP_GO_VERSION }} + - name: Set up Go + # https://github.com/actions/setup-go/releases/tag/v5.0.0 + uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 # v5.0.0 + with: + go-version-file: go.mod - - name: Generate Golang - run: | - export PATH=$PATH:/home/runner/go/bin/ + - name: Generate Golang + run: | + export PATH=$PATH:/home/runner/go/bin/ - - name: golangci-lint - uses: golangci/golangci-lint-action@v4.0.0 - with: - # Required: the version of golangci-lint is required and must be specified without patch version: we always use the latest patch version. - version: v1.55 + - name: Run golangci-lint + # https://github.com/golangci/golangci-lint-action/tree/v5.1.0 + uses: golangci/golangci-lint-action@9d1e0624a798bb64f6c3cea93db47765312263dc # v5.1.0 + with: + # The version of golangci-lint to use. + version: latest diff --git a/.gitignore b/.gitignore index 4599bc30..b38dfa49 100644 --- a/.gitignore +++ b/.gitignore @@ -3,6 +3,7 @@ /dist /build *.swp +*~ /.trash-cache /trash.lock /.idea