Skip to content

Commit

Permalink
Merge pull request #14 from godaddy/issue-templates
Browse files Browse the repository at this point in the history
Add issue templates
  • Loading branch information
dnasevic-godaddy committed Jul 4, 2023
2 parents 1c4543c + 61eb096 commit 9f7f32b
Show file tree
Hide file tree
Showing 11 changed files with 92 additions and 34 deletions.
27 changes: 27 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
---
name: Bug report
about: Create a report to help us improve
title: ''
labels: ''
assignees: ''

---

**Describe the bug**
A clear and concise description of what the bug is.

**To Reproduce**
Steps to reproduce the behavior:
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error

**Expected behavior**
A clear and concise description of what you expected to happen.

**Screenshots**
If applicable, add screenshots to help explain your problem.

**Additional context**
Add any other context about the problem here.
20 changes: 20 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
name: Feature request
about: Suggest an idea for this project
title: ''
labels: ''
assignees: ''

---

**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

**Describe the solution you'd like**
A clear and concise description of what you want to happen.

**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.

**Additional context**
Add any other context or screenshots about the feature request here.
22 changes: 22 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<!--
Thanks for submitting a pull request! We appreciate you spending the time to work on these changes.
Please provide enough information so that others can review your pull request.
-->

## Summary

<!--
Explain the **motivation** for making this change.
-->

## Changelog

<!--
Help reviewers and the release process by writing your own changelog entry. See CHANGELOG.md
-->

## Test Plan

<!--
Demonstrate the code is solid. Example: Add specs for the change you make.
-->
4 changes: 2 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
- name: Setup Go
uses: actions/setup-go@v2
with:
go-version: '1.17.7'
go-version: '1.20.5'

- name: Build Linux
if: matrix.os == 'ubuntu-20.04'
Expand Down Expand Up @@ -76,7 +76,7 @@ jobs:
- name: Setup Go
uses: actions/setup-go@v2
with:
go-version: '1.17.7'
go-version: '1.20.5'

- name: Install OS dependencies
shell: bash
Expand Down
2 changes: 1 addition & 1 deletion .ruby-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3.2.0
3.2.2
4 changes: 4 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,7 @@ source 'https://rubygems.org'
gemspec

gem 'rake', '~> 13.0'
gem 'rspec', '~> 3.10.0'
gem 'rubocop', '~> 1.7'
gem 'simplecov', '~> 0.21.2'
gem 'simplecov-console', '~> 0.9.1'
5 changes: 0 additions & 5 deletions cobhan.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,4 @@ Gem::Specification.new do |spec|
spec.require_paths = ['lib']

spec.add_dependency 'ffi', '~> 1.15.4'

spec.add_development_dependency 'rspec', '~> 3.10.0'
spec.add_development_dependency 'rubocop', '~> 1.7'
spec.add_development_dependency 'simplecov', '~> 0.21.2'
spec.add_development_dependency 'simplecov-console', '~> 0.9.1'
end
6 changes: 3 additions & 3 deletions demo/demo.rb
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# frozen_string_literal: true

require 'cobhan'
require_relative './../spec/support/build_binary'
require_relative './../spec/support/measure_time'
require_relative './../spec/support/cobhan_module'
require_relative '../spec/support/build_binary'
require_relative '../spec/support/measure_time'
require_relative '../spec/support/cobhan_module'

LIB_ROOT_PATH = File.join(__dir__, '../tmp')
LIB_NAME = 'libcobhandemo'
Expand Down
2 changes: 1 addition & 1 deletion spec/support/build_binary.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@ def build_binary(lib_root_path, lib_name)
abort('Aborted.') unless input.downcase == 'y'
end

Dir.mkdir_p(lib_root_path)
FileUtils.mkdir_p(lib_root_path)
system("./spec/support/#{lib_name}/build.sh", exception: true)
end
2 changes: 1 addition & 1 deletion spec/support/libcobhandemo/arm64_build_and_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ DYN_EXT="so"
SYS_FN_PART="arm64"
GOARCH="arm64"
OUTPUT_FILE="$LIB_NAME-$SYS_FN_PART.$DYN_EXT"
DOCKER_IMG=golang:1.17.7-bullseye
DOCKER_IMG=golang:1.20.5-bullseye
BUILD_CMD="GOOS=linux GOARCH=$GOARCH go build -buildmode=c-shared -ldflags='-s -w' -o $OUTPUT_FILE $LIB_NAME.go"
BUILD_DIR="tmp/build/linux-arm64"

Expand Down
32 changes: 11 additions & 21 deletions spec/support/libcobhandemo/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
set -euo

LIB_NAME=libcobhandemo
ROOT_DIR=$(pwd)
SRC_DIR="spec/support/$LIB_NAME"

# Normalize machine architecture for file names
Expand All @@ -10,7 +11,7 @@ case $(uname -m) in
SYS_FN_PART="x64"
GOARCH="amd64"
;;
"aarch64")
"aarch64" | "arm64")
SYS_FN_PART="arm64"
GOARCH="arm64"
;;
Expand All @@ -23,17 +24,13 @@ esac
# OS Detection
case $(uname -s) in
"Darwin")
GOOS=darwin
DYN_EXT="dylib"
OUTPUT_FILE="$LIB_NAME-$SYS_FN_PART.$DYN_EXT"
DOCKER_IMG=neilotoole/xcgo:go1.17
BUILD_CMD="GOOS=darwin GOARCH=$GOARCH CC=o64-clang CXX=o64-clang++ go build -buildmode=c-shared -ldflags='-s -w' -o $OUTPUT_FILE $LIB_NAME.go"
BUILD_DIR="tmp/build/darwin"
;;
"Linux")
GOOS=linux
DYN_EXT="so"
OUTPUT_FILE="$LIB_NAME-$SYS_FN_PART.$DYN_EXT"
DOCKER_IMG=golang:1.17.7-bullseye
BUILD_CMD="GOOS=linux GOARCH=$GOARCH go build -buildmode=c-shared -ldflags='-s -w' -o $OUTPUT_FILE $LIB_NAME.go"
BUILD_DIR="tmp/build/linux"
;;
*)
Expand All @@ -42,21 +39,14 @@ case $(uname -s) in
;;
esac

OUTPUT_FILE="$LIB_NAME-$SYS_FN_PART.$DYN_EXT"
BUILD_CMD="GOOS=$GOOS GOARCH=$GOARCH go build -buildmode=c-shared -ldflags='-s -w' -o $OUTPUT_FILE $LIB_NAME.go"

mkdir -p $BUILD_DIR
cp -R $SRC_DIR/* $BUILD_DIR
cd $BUILD_DIR

# Debug
echo $BUILD_CMD
# docker run -it --rm --name cobhan-builder \
# --volume "$(pwd)/$BUILD_DIR":/usr/src/cobhan \
# -w /usr/src/cobhan \
# $DOCKER_IMG \
# bash

docker run --rm --name cobhan-builder \
--volume "$(pwd)/$BUILD_DIR":/usr/src/cobhan \
-w /usr/src/cobhan \
$DOCKER_IMG \
sh -c "$BUILD_CMD"

echo "$BUILD_CMD"
sh -c "$BUILD_CMD"
cd "$ROOT_DIR"
cp $BUILD_DIR/$OUTPUT_FILE tmp/

0 comments on commit 9f7f32b

Please sign in to comment.