mirror of
https://github.com/rjNemo/underscore
synced 2026-06-06 02:26:42 +00:00
add unit test pipeline (#8)
* add unit test pipeline * edit triggers * change version * change version * other try * other try * fix: redeclared function name Co-authored-by: Ruidy <rnemausat@newstore.com>
This commit is contained in:
parent
321b5f7844
commit
2d05b6c518
4 changed files with 28 additions and 3 deletions
26
.github/workflows/unit-test.yml
vendored
Normal file
26
.github/workflows/unit-test.yml
vendored
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
name: Unit Tests
|
||||
on: [ push, pull_request ]
|
||||
jobs:
|
||||
build:
|
||||
name: Build
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Install gotip
|
||||
run: |
|
||||
git clone --depth=1 https://go.googlesource.com/go $HOME/gotip
|
||||
cd $HOME/gotip/src
|
||||
./make.bash
|
||||
echo "GOROOT=$HOME/gotip" >> $GITHUB_ENV
|
||||
echo "$HOME/gotip/bin:$PATH" >> $GITHUB_PATH
|
||||
- name: Check out code into the Go module directory
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: Get dependencies
|
||||
run: |
|
||||
go get -v -t -d ./...
|
||||
if [ -f Gopkg.toml ]; then
|
||||
curl https://raw.githubusercontent.com/golang/dep/master/install.sh | sh
|
||||
dep ensure
|
||||
fi
|
||||
- name: Test
|
||||
run: go test -v ./...
|
||||
|
|
@ -2,7 +2,6 @@
|
|||
|
||||

|
||||

|
||||
|
||||

|
||||
|
||||

|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ import (
|
|||
u "github.com/rjNemo/underscore"
|
||||
)
|
||||
|
||||
func main() {
|
||||
func chaining() {
|
||||
sum := u.NewChain([]int{1, 2, 3, 4, 5, 6, 7, 8, 9}).
|
||||
// filter even numbers from the slice
|
||||
Filter(func(n int) bool { return n%2 == 0 }).
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ import (
|
|||
u "github.com/rjNemo/underscore"
|
||||
)
|
||||
|
||||
func main() {
|
||||
func filterMapReduce() {
|
||||
numbers := []int{1, 2, 3, 4, 5, 6, 7, 8, 9}
|
||||
// filter even numbers from the slice
|
||||
evens := u.Filter(numbers, func(n int) bool { return n%2 == 0 })
|
||||
|
|
|
|||
Loading…
Reference in a new issue