Skip to content
This repository has been archived by the owner on May 31, 2024. It is now read-only.

Commit

Permalink
Updating readme. adding badges.
Browse files Browse the repository at this point in the history
  • Loading branch information
GaryBrownEEngr committed Nov 29, 2023
1 parent 443490c commit 2f3c706
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 12 deletions.
16 changes: 16 additions & 0 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,26 @@ jobs:
echo "Threshold : $COVERAGE_THRESHOLD_PERCENT %"
totalCoverage=`go tool cover -func=coverage.out | grep total | grep -Eo '[0-9]+\.[0-9]+'`
echo "Current test coverage : $totalCoverage %"
echo "COVERAGE=$totalCoverage" >> $GITHUB_ENV
echo ${{github.ref}}
if (( $(echo "$totalCoverage $COVERAGE_THRESHOLD_PERCENT" | awk '{print ($1 >= $2)}') )); then
echo "OK"
else
echo "Current test coverage is below threshold. Please add more unit tests or adjust threshold to a lower value."
echo "Failed"
exit 1
fi
# https://eremeev.ca/posts/golang-test-coverage-github-action/
# https://dev.to/thejaredwilcurt/coverage-badge-with-github-actions-finally-59fa
- if: ${{ github.ref == 'refs/heads/main' }}
name: Create the Badge
uses: schneegans/dynamic-badges-action@v1.7.0
with:
auth: ${{ secrets.GIST_SECRET }}
gistID: 0a036dc69ea9afb4202e2d262fec1e1d
filename: GaryBrownEEngr_scratch_main.json
label: Test Coverage
message: ${{ env.COVERAGE }}
color: green
namedLogo: jest
31 changes: 19 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,13 @@
# Scratch
# Golang Scratch

Golang Scratch
[![Go Reference](https://pkg.go.dev/badge/github.com/GaryBrownEEngr/scratch.svg)](https://pkg.go.dev/github.com/GaryBrownEEngr/scratch)
[![Go CI](https://github.com/GaryBrownEEngr/scratch/actions/workflows/go.yml/badge.svg)](https://github.com/GaryBrownEEngr/scratch/actions/workflows/go.yml)
[![Go Report Card](https://goreportcard.com/badge/github.com/GaryBrownEEngr/scratch)](https://goreportcard.com/report/github.com/GaryBrownEEngr/scratch)
[![Coverage Badge](https://img.shields.io/endpoint?url=https://gist.githubusercontent.com/GaryBrownEEngr/0a036dc69ea9afb4202e2d262fec1e1d/raw/GaryBrownEEngr_scratch_main.json)](https://github.com/GaryBrownEEngr/scratch/actions)

Things to look into:
## A Scratch Game Engine for Golang

* https://github.com/jakecoffman/cp
* https://github.com/jakecoffman/cp-examples
* https://github.com/jakecoffman/cp-ebiten

## Build for Window

```bash
GOOS=windows go build ./examples/fallingturtles/
```
Golang Scratch is a reimagining of [Scratch](https://scratch.mit.edu/) created by MIT Media Lab. Every entity on the screen is a sprite that can be programmed independently.

## Example

Expand All @@ -23,3 +18,15 @@ go run github.com/GaryBrownEEngr/scratch/examples/DoublePendulum@latest
```

![Example Picture](https://github.com/GaryBrownEEngr/scratch/blob/main/examples/DoublePendulum/DoublePendulum.gif)

## Build for Window

```bash
GOOS=windows go build ./examples/fallingturtles/
```

## Things to Research

* https://github.com/jakecoffman/cp
* https://github.com/jakecoffman/cp-examples
* https://github.com/jakecoffman/cp-ebiten

0 comments on commit 2f3c706

Please sign in to comment.