Skip to content

Commit

Permalink
[tests-only] enable linter, docker, releases in gh actions (#3535)
Browse files Browse the repository at this point in the history
* enable linter in gh action

* enable linter in gh action

* stick to existing lint config

* stick to mockery and go-generate

* add changelog step

* remove changelog validation step

* remove changelog validation and linting step from drone

* remove changelog depends_on condition

* fix build step

* merge dockerfiles from master

* merge tools from master

* merge release and docker workflows from master

* fix ceph storage implementation

* remove release and docker pipelines from drone

* fix starlark syntax

* fix ceph storage driver

* fix ceph storage driver EmptyRecycle

* fix ceph storage driver lock methods

* fix ceph storage driver upload and space methods

* add changelog
  • Loading branch information
micbar authored Dec 9, 2022
1 parent 4b19ae9 commit 8f3ab78
Show file tree
Hide file tree
Showing 18 changed files with 331 additions and 478 deletions.
359 changes: 12 additions & 347 deletions .drone.star

Large diffs are not rendered by default.

29 changes: 29 additions & 0 deletions .github/workflows/changelog.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Check Changelog
on:
pull_request:
paths-ignore:
- ".github/**"
- "Makefile"
- "tools/**"
- "docs/**"
- "tests/**"
- ".drone.star"
- ".drone.env"
- ".fossa.yml"
- ".gitignore"
- ".gitmodules"
- "go.mod"
- "go.sum"

jobs:
check-changelog:
runs-on: self-hosted
steps:
- name: Checkout
uses: actions/[email protected]
- name: Setup Go environment
uses: actions/[email protected]
with:
go-version-file: go.mod
- name: Check changelog
run: make check-changelog PR=${{ github.event.pull_request.number }}
44 changes: 44 additions & 0 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: Build Docker
on:
push:
branches:
- "edge"
tags:
- "*"
pull_request:
workflow_dispatch:

jobs:
docker:
runs-on: self-hosted
strategy:
matrix:
include:
- tag: reva:${{ ((github.ref_type == 'tag') && github.ref_name) || 'edge' }}
file: Dockerfile.reva
- tag: revad:${{ ((github.ref_type == 'tag') && github.ref_name) || 'edge' }}
file: Dockerfile.revad
- tag: revad:${{ ((github.ref_type == 'tag') && github.ref_name) || 'edge' }}-eos
file: Dockerfile.revad-eos
- tag: revad:${{ ((github.ref_type == 'tag') && github.ref_name) || 'edge' }}-ceph
file: Dockerfile.revad-ceph
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login to Docker Hub
uses: docker/login-action@v2
if: ${{ github.event_name != 'pull_request' }}
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build ${{ ((github.event_name != 'pull_request') && 'and push') || '' }} ${{ matrix.tag }}
uses: docker/build-push-action@v3
with:
context: .
push: ${{ github.event_name != 'pull_request' }}
file: ${{ matrix.file }}
tags: ${{ ((github.event_name != 'pull_request') && format('{0}/{1}', secrets.DOCKERHUB_ORGANIZATION, matrix.tag)) || '' }}
21 changes: 21 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: Lint
on:
pull_request:
paths-ignore:
- "go.mod"
- "go.sum"
push:
workflow_dispatch:

jobs:
lint:
runs-on: self-hosted
steps:
- name: Checkout
uses: actions/[email protected]
- name: Setup Go environment
uses: actions/[email protected]
with:
go-version-file: go.mod
- name: Run linters
run: make lint
24 changes: 24 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Release
on:
push:
tags:
- "*"

jobs:
release:
runs-on: self-hosted
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup Go environment
uses: actions/[email protected]
with:
go-version-file: go.mod
- name: Make distribution
run: make dist VERSION=${{ github.ref_name }} GIT_COMMIT=${{ github.sha }} GO_VERSION=$(go version | awk '{print $3}')
- name: Release
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
files: "dist/*"
body_path: "changelog/NOTE.md"
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -51,3 +51,5 @@ tmp/

# drone
.drone.yml

toolchain
2 changes: 1 addition & 1 deletion Dockerfile.reva
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
# granted to it by virtue of its status as an Intergovernmental Organization
# or submit itself to any jurisdiction.

FROM golang:1.19-alpine as builder
FROM golang:alpine3.16 as builder

RUN apk --no-cache add \
ca-certificates \
Expand Down
4 changes: 2 additions & 2 deletions Dockerfile.revad
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
# granted to it by virtue of its status as an Intergovernmental Organization
# or submit itself to any jurisdiction.

FROM golang:1.19-alpine as builder
FROM golang:alpine3.16 as builder

RUN apk --no-cache add \
ca-certificates \
Expand All @@ -36,7 +36,7 @@ RUN make build-revad-docker && \

RUN mkdir -p /etc/revad/ && echo "" > /etc/revad/revad.toml

FROM golang:1.19-alpine
FROM golang:alpine3.16

RUN apk --no-cache add \
mailcap
Expand Down
12 changes: 6 additions & 6 deletions Dockerfile.revad-ceph
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
# granted to it by virtue of its status as an Intergovernmental Organization
# or submit itself to any jurisdiction.

FROM quay.ceph.io/ceph-ci/ceph:pacific
FROM quay.io/ceph/ceph:v16

RUN dnf update -y && dnf install -y \
git \
Expand All @@ -26,19 +26,19 @@ RUN dnf update -y && dnf install -y \
librbd-devel \
librados-devel

ADD https://golang.org/dl/go1.19.3.linux-amd64.tar.gz \
go1.19.3.linux-amd64.tar.gz
ADD https://golang.org/dl/go1.19.linux-amd64.tar.gz \
go1.19.linux-amd64.tar.gz

RUN rm -rf /usr/local/go && \
tar -C /usr/local -xzf go1.19.3.linux-amd64.tar.gz && \
rm go1.19.3.linux-amd64.tar.gz
tar -C /usr/local -xzf go1.19.linux-amd64.tar.gz && \
rm go1.19.linux-amd64.tar.gz

ENV PATH /go/bin:/usr/local/go/bin:$PATH
ENV GOPATH /go

WORKDIR /go/src/github/cs3org/reva
COPY . .
RUN mkdir -p /go/bin \
RUN mkdir -p /go/bin && \
make build-revad-cephfs-docker && \
cp /go/src/github/cs3org/reva/cmd/revad/revad /usr/bin/revad

Expand Down
32 changes: 15 additions & 17 deletions Dockerfile.revad-eos
Original file line number Diff line number Diff line change
Expand Up @@ -16,37 +16,35 @@
# granted to it by virtue of its status as an Intergovernmental Organization
# or submit itself to any jurisdiction.

FROM gitlab-registry.cern.ch/dss/eos/eos-all:4.8.66 as builder
FROM gitlab-registry.cern.ch/dss/eos/eos-fusex:4.8.91 as builder

RUN yum -y update && yum clean all

RUN yum -y install https://packages.endpointdev.com/rhel/7/os/x86_64/endpoint-repo.x86_64.rpm
RUN yum install -y make git gcc libc-dev bash epel-release && \
RUN yum -y install \
gcc \
git \
golang \
make && \
yum clean all && \
rm -rf /var/cache/yum

ADD https://golang.org/dl/go1.19.3.linux-amd64.tar.gz \
go1.19.3.linux-amd64.tar.gz
ADD https://golang.org/dl/go1.19.linux-amd64.tar.gz \
go1.19.linux-amd64.tar.gz

RUN rm -rf /usr/local/go && \
tar -C /usr/local -xzf go1.19.3.linux-amd64.tar.gz && \
rm go1.19.3.linux-amd64.tar.gz
tar -C /usr/local -xzf go1.19.linux-amd64.tar.gz && \
rm go1.19.linux-amd64.tar.gz

ENV PATH /go/bin:/usr/local/go/bin:$PATH
ENV GOPATH /go

WORKDIR /go/src/github/cs3org/reva
COPY . .
RUN make build-revad-docker && cp /go/src/github/cs3org/reva/cmd/revad/revad /usr/bin/revad

FROM gitlab-registry.cern.ch/dss/eos/eos-all:4.8.66

COPY --from=builder /usr/bin/revad /usr/bin/revad
RUN make build-revad-docker

RUN mkdir -p /etc/revad/ && echo "" > /etc/revad/revad.toml
RUN mkdir -p /usr/local/bin

FROM gitlab-registry.cern.ch/dss/eos/eos-all:4.8.91
COPY --from=builder /go/src/github/cs3org/reva/cmd/revad/revad /usr/bin/revad
RUN chmod +x /usr/bin/revad
RUN mkdir -p /etc/revad/ && \
touch /etc/revad/revad.toml

ENTRYPOINT [ "/usr/bin/revad" ]
CMD [ "-c", "/etc/revad/revad.toml", "-p", "/var/run/revad.pid" ]
Loading

0 comments on commit 8f3ab78

Please sign in to comment.