-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'monorepo-test' into monorepo
- Loading branch information
Showing
56 changed files
with
599 additions
and
0 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,2 @@ | ||
.makefiles | ||
.git |
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,2 @@ | ||
/artifacts | ||
/.makefiles |
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,7 @@ | ||
language: go | ||
go: '1.15' | ||
install: | ||
- go mod download | ||
- go install github.com/golang/protobuf/protoc-gen-go | ||
script: make ci | ||
after_success: bash <(curl -s https://codecov.io/bash) |
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 @@ | ||
FROM scratch | ||
|
||
COPY artifacts/build/release/linux/amd64/cmd1 /cmd1 | ||
COPY artifacts/build/release/linux/amd64/cmd2 /cmd2 |
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,21 @@ | ||
MIT License | ||
|
||
Copyright (c) 2019 James Harris, Erin Millard | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. |
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,9 @@ | ||
DOCKER_REPO := makefiles/test | ||
|
||
-include .makefiles/Makefile | ||
-include .makefiles/pkg/protobuf/v1/Makefile | ||
-include .makefiles/pkg/go/v1/Makefile | ||
-include .makefiles/pkg/docker/v1/Makefile | ||
|
||
.makefiles/%: | ||
@curl -sfL https://makefiles.dev/v1 | bash /dev/stdin "$@" |
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,7 @@ | ||
package main | ||
|
||
import "fmt" | ||
|
||
func main() { | ||
fmt.Println("cmd1") | ||
} |
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,7 @@ | ||
package main | ||
|
||
import "fmt" | ||
|
||
func main() { | ||
fmt.Println("cmd2") | ||
} |
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,5 @@ | ||
module github.com/make-files/test | ||
|
||
go 1.13 | ||
|
||
require github.com/golang/protobuf v1.3.2 |
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,2 @@ | ||
github.com/golang/protobuf v1.3.2 h1:6nsPYzhq5kReh6QImI3k5qWzO4PEbvbIW2cwSfR/6xs= | ||
github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= |
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 @@ | ||
package go1 | ||
|
||
// Global is a variable that is used in the tests. | ||
var Global *TestMessage |
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,8 @@ | ||
syntax = "proto3"; | ||
|
||
import "google/protobuf/any.proto"; | ||
option go_package = "go1"; | ||
|
||
message TestMessage { | ||
google.protobuf.Any any = 1; | ||
} |
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,8 @@ | ||
package go1_test | ||
|
||
import "testing" | ||
import . "github.com/make-files/test" | ||
|
||
func Test(t *testing.T) { | ||
Global = &TestMessage{} | ||
} |
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,13 @@ | ||
module.exports = { | ||
parserOptions: { | ||
ecmaVersion: 2019, | ||
}, | ||
env: { | ||
jest: true, | ||
node: true, | ||
}, | ||
rules: { | ||
'comma-dangle': ['error', 'always-multiline'], | ||
'no-console': 'warn', | ||
}, | ||
} |
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 @@ | ||
/.makefiles/ | ||
/artifacts/ | ||
/node_modules/ | ||
/yarn.lock |
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,10 @@ | ||
DOCKER_REPO := makefiles/test | ||
|
||
-include .makefiles/Makefile | ||
-include .makefiles/pkg/js/v1/Makefile | ||
-include .makefiles/pkg/js/v1/with-yarn.mk | ||
-include .makefiles/pkg/js/v1/with-webpack.mk | ||
-include .makefiles/pkg/docker/v1/Makefile | ||
|
||
.makefiles/%: | ||
@curl -sfL https://makefiles.dev/v1 | bash /dev/stdin "$@" |
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,6 @@ | ||
module.exports = { | ||
collectCoverageFrom: [ | ||
'src/**/*.js', | ||
], | ||
coverageDirectory: 'artifacts/coverage/jest', | ||
} |
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,13 @@ | ||
{ | ||
"private": true, | ||
"dependencies": { | ||
"stats-webpack-plugin": "^0.7.0", | ||
"webpack": "^4.41.5", | ||
"webpack-cli": "^3.3.10" | ||
}, | ||
"devDependencies": { | ||
"eslint": "^6.8.0", | ||
"jest": "^24.9.0", | ||
"webpack-bundle-analyzer": "^3.6.0" | ||
} | ||
} |
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 @@ | ||
console.log('This should not be here') |
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 @@ | ||
window.makefiles = true |
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 @@ | ||
module.exports = { | ||
functionA, | ||
functionB, | ||
} | ||
|
||
function functionA () { | ||
return 'a' | ||
} | ||
|
||
function functionB () { | ||
return 'b' | ||
} |
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 @@ | ||
module.exports = { | ||
functionA, | ||
functionB, | ||
} | ||
|
||
function functionA () { | ||
return 'a' | ||
} | ||
|
||
function functionB () { | ||
return 'b' | ||
} |
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,5 @@ | ||
const {functionA} = require('../../src/module-a.js') | ||
|
||
test('functionA()', () => { | ||
expect(functionA()).toBe('a') | ||
}) |
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,16 @@ | ||
const {join} = require('path') | ||
const StatsPlugin = require('stats-webpack-plugin') | ||
|
||
module.exports = (_, {mode = 'development'} = {}) => { | ||
const isProduction = mode === 'production' | ||
|
||
return { | ||
mode, | ||
output: { | ||
path: join(__dirname, 'artifacts/webpack/build', mode), | ||
}, | ||
plugins: [ | ||
new StatsPlugin('.stats.json'), | ||
], | ||
} | ||
} |
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,5 @@ | ||
/.makefiles/ | ||
/.phpunit.result.cache | ||
/artifacts/ | ||
/composer.lock | ||
/vendor/ |
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,13 @@ | ||
<?php | ||
|
||
$finder = PhpCsFixer\Finder::create() | ||
->in(__DIR__) | ||
->exclude([ | ||
'vendor', | ||
]); | ||
|
||
return PhpCsFixer\Config::create() | ||
->setRules([ | ||
'@PSR2' => true, | ||
]) | ||
->setFinder($finder); |
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,10 @@ | ||
DOCKER_REPO := makefiles/test | ||
PHP_PERIDOT_PRIMARY_REPORTER := dot | ||
PHP_PHPUNIT_RESULT_CACHE_FILE := | ||
|
||
-include .makefiles/Makefile | ||
-include .makefiles/pkg/php/v1/Makefile | ||
-include .makefiles/pkg/docker/v1/Makefile | ||
|
||
.makefiles/%: | ||
@curl -sfL https://makefiles.dev/v1 | bash /dev/stdin "$@" |
Empty file.
Empty file.
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,21 @@ | ||
{ | ||
"name": "makefiles/test", | ||
"description": "Test project for make-files/pkg-php", | ||
"license": "MIT", | ||
"require": { | ||
}, | ||
"require-dev": { | ||
"phpunit/phpunit": "^6", | ||
"peridot-php/peridot": "^1.19", | ||
"peridot-php/peridot-code-coverage-reporters": "^3.0", | ||
"peridot-php/leo": "^1.6", | ||
"peridot-php/peridot-dot-reporter": "^1.0", | ||
"friendsofphp/php-cs-fixer": "^2.16", | ||
"pcov/clobber": "^2.0" | ||
}, | ||
"autoload": { | ||
"psr-4": { | ||
"Makefiles\\Test\\": "src" | ||
} | ||
} | ||
} |
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,25 @@ | ||
<?php | ||
|
||
use Evenement\EventEmitterInterface; | ||
use Peridot\Console\Environment; | ||
use Peridot\Reporter\CodeCoverageReporters; | ||
use Peridot\Reporter\CodeCoverage\CodeCoverageReporter; | ||
use Peridot\Reporter\Dot\DotReporterPlugin; | ||
|
||
error_reporting(-1); | ||
|
||
return function (EventEmitterInterface $emitter) { | ||
new DotReporterPlugin($emitter); | ||
|
||
// set the default path | ||
$emitter->on('peridot.start', function (Environment $environment) { | ||
$environment->getDefinition()->getArgument('path')->setDefault('test/peridot'); | ||
}); | ||
|
||
$emitter->on('code-coverage.start', function (CodeCoverageReporter $reporter) { | ||
$reporter->addDirectoryToWhitelist(__DIR__ . '/src'); | ||
}); | ||
|
||
$coverage = new CodeCoverageReporters($emitter); | ||
$coverage->register(); | ||
}; |
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,23 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/8.4/phpunit.xsd" | ||
bootstrap="vendor/autoload.php" | ||
colors="true" | ||
executionOrder="depends,defects" | ||
forceCoversAnnotation="false" | ||
beStrictAboutCoversAnnotation="false" | ||
beStrictAboutOutputDuringTests="true" | ||
beStrictAboutTodoAnnotatedTests="true" | ||
verbose="true"> | ||
<testsuites> | ||
<testsuite name="default"> | ||
<directory suffix="Test.php">test</directory> | ||
</testsuite> | ||
</testsuites> | ||
|
||
<filter> | ||
<whitelist processUncoveredFilesFromWhitelist="true"> | ||
<directory suffix=".php">src</directory> | ||
</whitelist> | ||
</filter> | ||
</phpunit> |
Oops, something went wrong.