forked from opendatahub-io/data-science-pipelines-operator
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3 from opendatahub-io/main
[pull] main from opendatahub-io:main
- Loading branch information
Showing
20 changed files
with
354 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
ARG CI_BASE=registry.access.redhat.com/ubi8 | ||
|
||
FROM ${CI_BASE} as stage1 | ||
|
||
ARG GOLANGCI_LINT_VERSION=1.51.1 | ||
ARG REVIVE_VERSION=v1.2.5 | ||
ARG STATICCHECK_VERSION=v0.3.3 | ||
ARG INEFFASSIGN_VERSION=13ace05 | ||
ARG ERRCHECK_VERSION=v1.6.3 | ||
ARG GHCLI_VERSION=2.23.0 | ||
|
||
ENV GOPATH=/build \ | ||
GO111MODULE=on \ | ||
PATH=/build/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin | ||
|
||
WORKDIR /build/src | ||
|
||
RUN dnf -y install \ | ||
golang \ | ||
git | ||
|
||
RUN go install github.com/mgechev/revive@${REVIVE_VERSION} | ||
RUN go install honnef.co/go/tools/cmd/staticcheck@${STATICCHECK_VERSION} | ||
RUN go install github.com/gordonklaus/ineffassign@${INEFFASSIGN_VERSION} | ||
RUN go install github.com/kisielk/errcheck@${ERRCHECK_VERSION} | ||
|
||
RUN curl -L -o /tmp/golangci-lint.tar.gz \ | ||
https://github.com/golangci/golangci-lint/releases/download/v${GOLANGCI_LINT_VERSION}/golangci-lint-${GOLANGCI_LINT_VERSION}-linux-amd64.tar.gz | ||
RUN tar -C /tmp -xv --strip-components=1 -f /tmp/golangci-lint.tar.gz && \ | ||
cp /tmp/golangci-lint /build/bin/ | ||
|
||
RUN curl -L -o /tmp/ghcli.tar.gz https://github.com/cli/cli/releases/download/v${GHCLI_VERSION}/gh_${GHCLI_VERSION}_linux_amd64.tar.gz | ||
RUN tar -C /tmp -xv --strip-components=1 -f /tmp/ghcli.tar.gz && \ | ||
cp /tmp/bin/gh /build/bin/ | ||
|
||
FROM ${CI_BASE} | ||
|
||
ENV SUMMARY="Toolchain for running pre-commit hooks." \ | ||
DESCRIPTION="Toolchain for running pre-commit hooks." \ | ||
PATH=/build/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin \ | ||
GO111MODULE=on | ||
|
||
LABEL summary="$SUMMARY" \ | ||
description="$DESCRIPTION" \ | ||
io.k8s.description="$DESCRIPTION" \ | ||
io.k8s.display-name="Pre-Commit Toolchain" \ | ||
io.openshift.tags="pre-commit" | ||
|
||
COPY --from=stage1 /build/bin /build/bin | ||
|
||
RUN dnf -y install \ | ||
python39 \ | ||
python3-pip \ | ||
golang \ | ||
git \ | ||
make \ | ||
&& \ | ||
dnf clean all | ||
|
||
WORKDIR /build/src | ||
|
||
COPY requirements.txt /tmp/requirements.txt | ||
RUN python3 -m venv /build | ||
|
||
RUN . /build/bin/activate && \ | ||
python3 -m pip install -U pip && \ | ||
python3 -m pip install -r /tmp/requirements.txt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
[[source]] | ||
name = "pypi" | ||
url = "https://pypi.org/simple" | ||
verify_ssl = true | ||
|
||
[dev-packages] | ||
|
||
[requires] | ||
python_version = "3.9.16" | ||
|
||
[packages] | ||
pre-commit = "~=2.17.0" |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
# Pre-Commit Go Toolchain | ||
|
||
The artifacts in this folder are used for running pre-commit CI against Pull Requests in this repo. For the pre-commit | ||
configuration, see the `.github/workflows` directory. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# | ||
# These requirements were autogenerated by pipenv | ||
# To regenerate from the project's Pipfile, run: | ||
# | ||
# pipenv lock --requirements | ||
# | ||
|
||
-i https://pypi.org/simple | ||
cfgv==3.3.1; python_full_version >= '3.6.1' | ||
distlib==0.3.6 | ||
filelock==3.9.0; python_version >= '3.7' | ||
identify==2.5.17; python_version >= '3.7' | ||
nodeenv==1.7.0; python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3, 3.4, 3.5, 3.6' | ||
platformdirs==3.0.0; python_version >= '3.7' | ||
pre-commit==2.17.0 | ||
pyyaml==6.0; python_version >= '3.6' | ||
toml==0.10.2; python_version >= '2.6' and python_version not in '3.0, 3.1, 3.2' | ||
virtualenv==20.19.0; python_version >= '3.7' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
name: Pre-commit | ||
on: | ||
push: | ||
branches: | ||
- '**' | ||
tags-ignore: | ||
- 'v*' | ||
pull_request: | ||
workflow_dispatch: | ||
|
||
jobs: | ||
precommit: | ||
runs-on: ubuntu-latest | ||
container: | ||
image: quay.io/opendatahub/pre-commit-go-toolchain:v0.1 | ||
env: | ||
XDG_CACHE_HOME: /cache | ||
GOCACHE: /cache/go-build | ||
GOMODCACHE: /cache/go-mod | ||
PRE_COMMIT_HOME: /cache/pre-commit | ||
volumes: | ||
- /cache | ||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- name: Activate cache | ||
uses: actions/cache@v2 | ||
with: | ||
path: /cache | ||
key: ${{ runner.os }}-cache-${{ hashFiles('**/go.sum', '.pre-commit-config.yaml') }} | ||
|
||
- name: Run pre-commit checks | ||
run: pre-commit run --all-files |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
run: | ||
timeout: 5m | ||
linters: | ||
enable: | ||
- errcheck | ||
- gosimple | ||
- govet | ||
- ineffassign | ||
- staticcheck | ||
- typecheck | ||
- unused | ||
- revive |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
repos: | ||
- repo: https://github.com/pre-commit/pre-commit-hooks | ||
rev: v3.3.0 | ||
hooks: | ||
- id: trailing-whitespace | ||
exclude: README.md | ||
- id: check-merge-conflict | ||
- id: end-of-file-fixer | ||
- id: check-added-large-files | ||
- id: check-case-conflict | ||
- id: check-json | ||
- id: check-symlinks | ||
- id: detect-private-key | ||
|
||
- repo: https://github.com/adrienverge/yamllint.git | ||
rev: v1.25.0 | ||
hooks: | ||
- id: yamllint | ||
files: \.(yaml|yml)$ | ||
types: [file, yaml] | ||
entry: yamllint --strict | ||
|
||
- repo: https://github.com/dnephin/pre-commit-golang | ||
rev: c17f835cf9 | ||
hooks: | ||
- id: go-fmt | ||
- id: golangci-lint | ||
- id: go-unit-tests | ||
- id: go-build | ||
- id: go-mod-tidy |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
extends: default | ||
rules: | ||
line-length: disable | ||
document-start: disable | ||
indentation: | ||
indent-sequences: whatever | ||
comments-indentation: disable | ||
hyphens: | ||
max-spaces-after: 4 | ||
truthy: | ||
check-keys: false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,5 +9,6 @@ reviewers: | |
- DharmitD | ||
- gmfrasca | ||
- gregsheremeta | ||
- harshad16 | ||
- HumairAK | ||
- rimolive |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
|
||
# Prometheus Monitor Service (Metrics) | ||
apiVersion: monitoring.coreos.com/v1 | ||
kind: ServiceMonitor | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.