Skip to content

Commit

Permalink
Initial commit (#1) (#2)
Browse files Browse the repository at this point in the history
* added all source code except build files

* changed imports from bitbucket to github.com/oracle-samples

* Added build and makefile

* added release pipeline

* changed the order

* using explicit token

* using docker command directly

* using github token

* corrected image repo name

* using repo from vars and using makefile
  • Loading branch information
rajashekhargundeti authored Jan 30, 2023
1 parent 38e4a2a commit 040bdb2
Show file tree
Hide file tree
Showing 3,136 changed files with 1,075,227 additions and 36 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
34 changes: 34 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Unit Tests

on:
pull_request: {}
push: {}
jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:

- name: Set up Go 1.x
uses: actions/setup-go@v2
with:
go-version: 1.17.5
id: go

- name: Check out code into the Go module directory
uses: actions/checkout@v2

- name: build the binary
run: |
go build -mod vendor -o dist/provider ./cmd/server/main.go
- name: Run Unit Tests
run: |
go test -covermode=count -coverprofile=profile.cov ./...
- name: Send coverage
env:
COVERALLS_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
GO111MODULE=off go get github.com/mattn/goveralls
$(go env GOPATH)/bin/goveralls -coverprofile=profile.cov -service=github
34 changes: 34 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Release

on:
push:
# Build and publish artifacts for a release
tags:
- "v*.*.*"

jobs:
build:
runs-on: ubuntu-latest
env:
IMAGE_REGISTRY: ${{ vars.IMAGE_REGISTRY }}
steps:

- name: Checkout
uses: actions/checkout@v3.3.0

- name: Set up QEMU
uses: docker/setup-qemu-action@v2
with:
platforms: amd64

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2

- name: Log into GitHub Container Registry
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${GITHUB_ACTOR,,} --password-stdin

- name: Build Image
run: IMAGE_REGISTRY="${{ env.IMAGE_REGISTRY }}" make docker-build

- name: Push Image
run: IMAGE_REGISTRY="${{ env.IMAGE_REGISTRY }}" make docker-push
7 changes: 7 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Binary folder
dist/
__debug_bin
# OCI Build folders
input_ocibuild/
output_ocibuild_dockerize_provider/
output_ocibuild_make_helm/
48 changes: 48 additions & 0 deletions .golangci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
linters:
disable-all: true
enable:
# Linters enabled by default in golangci-lint 1.46.2.
# Default linters are listed explicitly for reproducibility and better control over linting rules.
# It's recommended to revisit this list after golangci-lint updates.
- deadcode
- errcheck
- gosimple
- govet
- ineffassign
- staticcheck
- structcheck
- typecheck
- unused
- varcheck

# Additional linters
- contextcheck # checks whether the function use a non-inherited context
- cyclop # checks function and package cyclomatic complexity
- dupl # detects code duplication/copy-pasting
- funlen # detects long functions
- gocritic # check for bugs, performance and style issues
- gofmt # checks whether code was gofmt-ed
- gosec # inspects source code for security problems
- ireturn # checks that function accept interfaces and return concrete types
- lll # reports long lines
- nilnil # checks that there is no simultaneous return of nil error and an invalid value
- nolintlint # reports ill-formed or insufficient nolint directives
- revive # finds out style issues, drop-in replacement of golint
- tenv # detects using os.Setenv instead of t.Setenv
- thelper # detects Go test helpers without t.Helper() call and checks the consistency of test helpers

linters-settings:
nolintlint:
# Disable to ensure that nolint directives don't have a leading space,
# because machine-readable comments should have no space by Go convention.
allow-leading-space: false
# Enable to require an explanation of nonzero length after each nolint directive.
require-explanation: true
# Enable to require nolint directives to mention the specific linter being suppressed.
require-specific: true
tenv:
# The option `all` will run against whole test files (`_test.go`) regardless of method/function signatures.
# By default, only methods that take `*testing.T`, `*testing.B`, and `testing.TB` as arguments are checked.
all: true
dupl:
threshold: 200
10 changes: 4 additions & 6 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
*Detailed instructions on how to contribute to the project, if applicable. Must include section about Oracle Contributor Agreement with link and instructions*

# Contributing to this repository

We welcome your contributions! There are multiple ways to contribute.
Expand Down Expand Up @@ -37,14 +35,14 @@ can be accepted.

1. Ensure there is an issue created to track and discuss the fix or enhancement
you intend to submit.
1. Fork this repository.
1. Fork this repository
1. Create a branch in your fork to implement the changes. We recommend using
the issue number as part of your branch name, e.g. `1234-fixes`.
the issue number as part of your branch name, e.g. `1234-fixes`
1. Ensure that any documentation is updated with the changes that are required
by your change.
1. Ensure that any samples are updated if the base image has been changed.
1. Submit the pull request. *Do not leave the pull request blank*. Explain exactly
what your changes are meant to do and provide simple steps on how to validate.
what your changes are meant to do and provide simple steps on how to validate
your changes. Ensure that you reference the issue you created as well.
1. We will assign the pull request to 2-3 people for review before it is merged.

Expand All @@ -54,4 +52,4 @@ Follow the [Golden Rule](https://en.wikipedia.org/wiki/Golden_Rule). If you'd
like more specific guidelines, see the [Contributor Covenant Code of Conduct][COC].

[OCA]: https://oca.opensource.oracle.com
[COC]: https://www.contributor-covenant.org/version/1/4/code-of-conduct/
[COC]: https://www.contributor-covenant.org/version/1/4/code-of-conduct/
Loading

0 comments on commit 040bdb2

Please sign in to comment.