Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HSPC-171: added building hyperstyle image from the dev branch hyperstyle repository #126

Merged
merged 5 commits into from
Sep 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -339,6 +339,19 @@ jobs:
image_name_tag: typescript:4.8.4
username: ${{ secrets.REGISTRY_USER }}
password: ${{ secrets.REGISTRY_PASSWORD }}
build_hyperstyle_image:
name: Build epicbox/hyperstyle image
runs-on: [ self-hosted, small ]
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Build
uses: ./.github/workflows/actions/build
with:
path: epicbox-hyperstyle
image_name_tag: hyperstyle:ij-2024.9
username: ${{ secrets.REGISTRY_USER }}
password: ${{ secrets.REGISTRY_PASSWORD }}

clean_untagged_images:
name: Clean untagged images
Expand Down Expand Up @@ -368,6 +381,7 @@ jobs:
- build_scala2_image
- build_scala3_image
- build_typescript_image
- build_hyperstyle_image
runs-on: [ self-hosted, small ]
steps:
- uses: hyperskill/[email protected]
Expand Down
69 changes: 69 additions & 0 deletions epicbox-hyperstyle/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
FROM stepik/hyperstyle-base:py3.8.11-java11.0.11-node14.17.3-go1.18.5

ENV ESLINT_VERSION 7.5.0

ENV LINTERS_DIRECTORY /opt/linters

ENV CHECKSTYLE_VERSION 8.44
ENV CHECKSTYLE_DIRECTORY ${LINTERS_DIRECTORY}/checkstyle

ENV DETEKT_VERSION 1.14.2
ENV DETEKT_DIRECTORY ${LINTERS_DIRECTORY}/detekt

ENV PMD_VERSION 6.37.0
ENV PMD_DIRECTORY ${LINTERS_DIRECTORY}/pmd

ENV GOLANG_LINT_VERSION 1.49.0
ENV GOLANG_LINT_DIRECTORY ${LINTERS_DIRECTORY}/golangci-lint

RUN apt-get update && apt-get install -y build-essential libssl-dev libffi-dev python3-dev git

RUN git clone --branch develop https://github.com/hyperskill/hyperstyle.git /review

RUN mkdir -p ${CHECKSTYLE_DIRECTORY} && \
mkdir -p ${DETEKT_DIRECTORY} && \
mkdir -p ${PMD_DIRECTORY} && \
mkdir -p ${GOLANG_LINT_DIRECTORY}

# Install Curl and Unzip
RUN apt -y update && \
apt -y upgrade && \
apt -y install curl unzip

# Install eslint
RUN npm install eslint@${ESLINT_VERSION} -g && \
eslint --init

# Install Detekt and Detekt-formatting
RUN curl -sSLO https://github.com/detekt/detekt/releases/download/v${DETEKT_VERSION}/detekt-cli-${DETEKT_VERSION}.zip && \
unzip detekt-cli-${DETEKT_VERSION}.zip -d ${DETEKT_DIRECTORY} && \
curl -H "Accept: application/zip" https://repo.maven.apache.org/maven2/io/gitlab/arturbosch/detekt/detekt-formatting/${DETEKT_VERSION}/detekt-formatting-${DETEKT_VERSION}.jar -o ${DETEKT_DIRECTORY}/detekt-formatting-${DETEKT_VERSION}.jar

# Install Checkstyle
RUN curl -L https://github.com/checkstyle/checkstyle/releases/download/checkstyle-${CHECKSTYLE_VERSION}/checkstyle-${CHECKSTYLE_VERSION}-all.jar > ${CHECKSTYLE_DIRECTORY}/checkstyle-${CHECKSTYLE_VERSION}-all.jar

# Install PMD
RUN curl -sSLO https://github.com/pmd/pmd/releases/download/pmd_releases/${PMD_VERSION}/pmd-bin-${PMD_VERSION}.zip && \
unzip pmd-bin-${PMD_VERSION}.zip -d ${PMD_DIRECTORY}

# Install golangci-lint
RUN curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | \
sh -s -- -b ${GOLANG_LINT_DIRECTORY} v${GOLANG_LINT_VERSION}

# Install third party golang libraries and pre-cache them by compiling main.go
COPY go.mod go.sum main.go ./

RUN go mod download && \
go mod verify && \
go mod tidy && \
go run main.go && \
rm main.go && \
chmod ugo-w go.mod go.sum

RUN pip install -r ./review/requirements-build.txt --verbose
RUN pip install -r ./review/requirements.txt --verbose
RUN pip install -r ./review/requirements-test.txt --verbose

RUN pip install ./review --use-feature=in-tree-build

CMD ["/bin/bash"]
15 changes: 15 additions & 0 deletions epicbox-hyperstyle/go.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
module main

go 1.18

require (
github.com/jmoiron/sqlx v1.3.5
github.com/mattn/go-sqlite3 v1.14.13
gorm.io/driver/sqlite v1.3.2
gorm.io/gorm v1.23.5
)

require (
github.com/jinzhu/inflection v1.0.0 // indirect
github.com/jinzhu/now v1.1.5 // indirect
)
31 changes: 31 additions & 0 deletions epicbox-hyperstyle/go.sum
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/go-sql-driver/mysql v1.6.0 h1:BCTh4TKNUYmOmMUcQ3IipzF5prigylS7XXjEkfCHuOE=
github.com/go-sql-driver/mysql v1.6.0/go.mod h1:DCzpHaOWr8IXmIStZouvnhqoel9Qv2LBy8hT2VhHyBg=
github.com/jinzhu/inflection v1.0.0 h1:K317FqzuhWc8YvSVlFMCCUb36O/S9MCKRDI7QkRKD/E=
github.com/jinzhu/inflection v1.0.0/go.mod h1:h+uFLlag+Qp1Va5pdKtLDYj+kHp5pxUVkryuEj+Srlc=
github.com/jinzhu/now v1.1.4/go.mod h1:d3SSVoowX0Lcu0IBviAWJpolVfI5UJVZZ7cO71lE/z8=
github.com/jinzhu/now v1.1.5 h1:/o9tlHleP7gOFmsnYNz3RGnqzefHA47wQpKrrdTIwXQ=
github.com/jinzhu/now v1.1.5/go.mod h1:d3SSVoowX0Lcu0IBviAWJpolVfI5UJVZZ7cO71lE/z8=
github.com/jmoiron/sqlx v1.3.5 h1:vFFPA71p1o5gAeqtEAwLU4dnX2napprKtHr7PYIcN3g=
github.com/jmoiron/sqlx v1.3.5/go.mod h1:nRVWtLre0KfCLJvgxzCsLVMogSvQ1zNJtpYr2Ccp0mQ=
github.com/lib/pq v1.2.0 h1:LXpIM/LZ5xGFhOpXAQUIMM1HdyqzVYM13zNdjCEEcA0=
github.com/lib/pq v1.2.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo=
github.com/mattn/go-sqlite3 v1.14.6/go.mod h1:NyWgC/yNuGj7Q9rpYnZvas74GogHl5/Z4A/KQRfk6bU=
github.com/mattn/go-sqlite3 v1.14.12/go.mod h1:NyWgC/yNuGj7Q9rpYnZvas74GogHl5/Z4A/KQRfk6bU=
github.com/mattn/go-sqlite3 v1.14.13 h1:1tj15ngiFfcZzii7yd82foL+ks+ouQcj8j/TPq3fk1I=
github.com/mattn/go-sqlite3 v1.14.13/go.mod h1:NyWgC/yNuGj7Q9rpYnZvas74GogHl5/Z4A/KQRfk6bU=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY=
github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c h1:dUUwHk2QECo/6vqA44rthZ8ie2QXMNeKRTHCNY2nXvo=
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
gorm.io/driver/sqlite v1.3.2 h1:nWTy4cE52K6nnMhv23wLmur9Y3qWbZvOBz+V4PrGAxg=
gorm.io/driver/sqlite v1.3.2/go.mod h1:B+8GyC9K7VgzJAcrcXMRPdnMcck+8FgJynEehEPM16U=
gorm.io/gorm v1.23.4/go.mod h1:l2lP/RyAtc1ynaTjFksBde/O8v9oOGIApu2/xRitmZk=
gorm.io/gorm v1.23.5 h1:TnlF26wScKSvknUC/Rn8t0NLLM22fypYBlvj1+aH6dM=
gorm.io/gorm v1.23.5/go.mod h1:l2lP/RyAtc1ynaTjFksBde/O8v9oOGIApu2/xRitmZk=
11 changes: 11 additions & 0 deletions epicbox-hyperstyle/main.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
package main

import (
_ "github.com/jmoiron/sqlx"
_ "github.com/mattn/go-sqlite3"
_ "gorm.io/driver/sqlite"
_ "gorm.io/gorm"
)

func main() {
}
Loading