Skip to content

Commit

Permalink
Merge pull request #4 from prefixaut/develop
Browse files Browse the repository at this point in the history
StepMania Update
  • Loading branch information
prefixaut authored Mar 27, 2022
2 parents a74277e + 75a12a5 commit 5e8752a
Show file tree
Hide file tree
Showing 28 changed files with 3,527 additions and 584 deletions.
147 changes: 60 additions & 87 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,21 +1,22 @@
---
name: 'Build the application'
name: Building & Testing

on:
push:
branches: [ '*' ]
tags: [ '*' ]
pull_request:
branches: [ master ]
on: ['push', 'pull_request']

jobs:
build:
name: Build on ${{ matrix.os }} with nim ${{ matrix.nim }}

strategy:
matrix:
nim: [ '1.6.x', 'stable', 'devel' ]
os: [ 'ubuntu-latest', 'windows-latest', 'macos-latest' ]
nim:
- '1.6.x'
#- 'stable'
#- 'devel'
os:
- 'ubuntu-latest'
#- 'windows-latest'
#- 'macos-latest'

runs-on: ${{ matrix.os }}

Expand All @@ -34,97 +35,69 @@ jobs:
key: ${{ runner.os }}-nimble-${{ matrix.nim }}-${{ hashFiles('*.nimble') }}
if: runner.os != 'Windows'

# Building & Testing
# Building
- name: Install dependencies
run: nimble install -Y

- name: Run tests
# Tests need to be added like this, because when you
# try to import/include them properly, they won't compile
# update correctly, and will forever fail for no reason.
run: |
nim r tests/tmemo.nim
nim r tests/tmemson.nim
- name: Build CLI
run: nim cli
run: nimble build

- name: Build library
run: nim lib

update-docs:
name: Update documentation
run: nimble clib

if: ${{ github.ref == 'refs/heads/master' }}
needs: [build]

runs-on: ubuntu-latest

steps:
# Basic Setup
- uses: actions/checkout@v2
- name: Setup Nim Environment 1.6.x
uses: jiro4989/setup-nim-action@v1
# Install perl on windows (linux and macos already have it installed)
- uses: shogo82148/actions-setup-perl@v1
if: runner.os == 'Windows'
with:
nim-version: 1.6.x
- name: Cache nimble
id: cache-nimble
uses: actions/cache@v1
perl-version: '5.32'
distribution: strawberry

# Install lcov
- name: Clone lcov
if: runner.os != 'Linux'
uses: actions/checkout@v2
with:
path: ~/.nimble
key: ${{ runner.os }}-nimble-${{ matrix.nim }}-${{ hashFiles('*.nimble') }}

# Update documentation
- name: Build documentation
run: nim docs
if: ${{ runner.os == 'Linux' && github.ref == 'refs/heads/master' }}
- name: Deploy to GitHub-Pages
uses: JamesIves/github-pages-deploy-action@v4.2.3
if: ${{ runner.os == 'Linux' && github.ref == 'refs/heads/master' }}
repository: 'linux-test-project/lcov'
path: './clones/lcov'
- name: Install lcov (Unix)
if: runner.os == 'Linux'
run: sudo apt-get install -y lcov
- name: Install lcov (MacOS)
if: runner.os == 'macOS'
run: echo "todo"
- name: Install lcov (Windows)
if: runner.os == 'Windows'
run: |
echo "perl .\clones\lcov\bin\lcov %*" > lcov
echo "perl .\clones\lcov\bin\gendesc %*" > gendesc
echo "perl .\clones\lcov\bin\genhtml %*" > genhtml
echo "perl .\clones\lcov\bin\geninfo %*" > geninfo
echo "perl .\clones\lcov\bin\genpng %*" > genpng
echo "PATH=%PATH%;%cd%" >> $GITHUB_ENV
# Testing & Converage
- name: Run tests with converage
run: coco --target 'tests/**/*.nim' --cov '!tests,!nimcache' -b --compiler '--hints:off' --gen_html=false

- name: 'Upload converage partial: ${{ runner.os }} - ${{ matrix.nim }}'
uses: coverallsapp/github-action@master
with:
branch: gh-pages
folder: docs

release:
name: Release ${{ matrix.os }} with nim 1.6.x
github-token: ${{ secrets.github_token }}
flag-name: run-${{ runner.os }}-${{ matrix.nim }}
parallel: true
path-to-lcov: ./lcov.info

if: ${{ startsWith(github.ref, 'refs/tags/') }}
needs: [build]
upload-coverage:
name: Upload converage

strategy:
matrix:
os: [ 'ubuntu-latest', 'windows-latest', 'macos-latest' ]
runs-on: ubuntu-latest

runs-on: ${{ matrix.os }}
permissions:
contents: write
if: ${{ always() }}
needs: [ 'build' ]

steps:
# Basic Setup
- uses: actions/checkout@v2
- name: Setup Nim Environment 1.6.x
uses: jiro4989/setup-nim-action@v1
with:
nim-version: 1.6.x
- name: Cache nimble
id: cache-nimble
uses: actions/cache@v1
with:
path: ~/.nimble
key: ${{ runner.os }}-nimble-${{ matrix.nim }}-${{ hashFiles('*.nimble') }}
if: runner.os != 'Windows'

# Releases
- name: Create CLI Release Build
run: nim cli -d:release

- name: Create Library Release Build
run: nim build -d:release

- name: Release
uses: ncipollo/release-action@v1
- name: Coveralls Finished
uses: coverallsapp/github-action@master
with:
artifacts: "dist/*"
allowUpdates: true
prerelease: ${{ endsWith(github.ref, 'rc') || endsWith(github.ref, 'snapshot') }}
token: ${{ secrets.GITHUB_TOKEN }}
github-token: ${{ secrets.github_token }}
parallel-finished: true
37 changes: 37 additions & 0 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
---
name: Documentation update

on:
push:
branches: [ 'master' ]

jobs:
update-docs:
name: Update Documentation

runs-on: ubuntu-latest

steps:
# Basic Setup
- uses: actions/checkout@v2
- name: Setup Nim Environment 1.6.x
uses: jiro4989/setup-nim-action@v1
with:
nim-version: 1.6.x
- name: Cache nimble
id: cache-nimble
uses: actions/cache@v1
with:
path: ~/.nimble
key: ${{ runner.os }}-nimble-${{ matrix.nim }}-${{ hashFiles('*.nimble') }}

# Build documentation
- name: Build documentation
run: nimble docs

# Deploy the documentation
- name: Deploy to GitHub-Pages
uses: JamesIves/github-pages-deploy-action@v4.2.3
with:
branch: gh-pages
folder: docs
49 changes: 49 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
---
name: Release

on:
push:
tags: [ '*' ]

jobs:
release:
name: Release ${{ matrix.os }} with nim 1.6.x

strategy:
matrix:
os: [ 'ubuntu-latest', 'windows-latest', 'macos-latest' ]

runs-on: ${{ matrix.os }}
permissions:
contents: write

steps:
# Basic Setup
- uses: actions/checkout@v2
- name: Setup Nim Environment 1.6.x
uses: jiro4989/setup-nim-action@v1
with:
nim-version: 1.6.x
- name: Cache nimble
id: cache-nimble
uses: actions/cache@v1
with:
path: ~/.nimble
key: ${{ runner.os }}-nimble-${{ matrix.nim }}-${{ hashFiles('*.nimble') }}
if: runner.os != 'Windows'

# Build the release elements
- name: Create Library Release Build
run: nimble clib -d:release

- name: Create CLI Release Build
run: nimble build -d:release

# Create/Update the release
- name: Release
uses: ncipollo/release-action@v1
with:
artifacts: "dist/*"
allowUpdates: true
prerelease: ${{ endsWith(github.ref, 'rc') || endsWith(github.ref, 'snapshot') }}
token: ${{ secrets.GITHUB_TOKEN }}
8 changes: 8 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@ thumbs.db
####
/dist
/docs
/bin
/*.json
/coverage

####
## Test Files
Expand All @@ -22,6 +24,12 @@ thumbs.db
/tests/**/*.js
/outputGotten.txt
/testresults
/lcov.info

####
## Temp File
####
generated_not_to_break_here

####
## Misc
Expand Down
Loading

0 comments on commit 5e8752a

Please sign in to comment.