Skip to content

Commit

Permalink
feat: Fix tests and add semantic release.
Browse files Browse the repository at this point in the history
  • Loading branch information
vantreeseba committed Sep 4, 2020
1 parent 678cb6e commit 8f191c6
Show file tree
Hide file tree
Showing 5 changed files with 145 additions and 32 deletions.
45 changes: 45 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: CI

on:
push:
branches:
- master
# pull_request:
# branches:
# - master
jobs:
unit_tests:
strategy:
matrix:
os: [ubuntu-latest, macos-latest]
haxe: [4.0.5]
fail-fast: true
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
- uses: krdlab/setup-haxe@v1
with:
haxe-version: ${{ matrix.haxe }}
- run: haxe -version
- run: haxelib install test.hxml --always
- name: Compile test code
run: haxelib run munit t
semantic_release:
needs: unit_tests
name: semantic_release
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Set up Node.js
uses: actions/setup-node@v1
- name: Setup haxe
uses: krdlab/setup-haxe@v1
- name: Run semantic release
env: # Or as an environment variable
GH_TOKEN: ${{ secrets.GH_TOKEN }}
HAXELIB_PASS: ${{secrets.HAXELIB_PASS}}
NPM_TOKEN: ${{secrets.NPM_TOKEN}}
run: |
npm ci
npx semantic-release
62 changes: 62 additions & 0 deletions .releaserc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
{
"branches": [
"master"
],
"tagFormat": "${version}",
"plugins": [
[
"@semantic-release/commit-analyzer",
{
"preset": "angular",
"parserOpts": {
"noteKeywords": [
"BREAKING CHANGE",
"BREAKING CHANGES",
"BREAKING"
]
}
}
],
[
"@semantic-release/release-notes-generator",
{
"preset": "angular",
"parserOpts": {
"noteKeywords": [
"BREAKING CHANGE",
"BREAKING CHANGES",
"BREAKING"
]
},
"writerOpts": {
"commitsSort": [
"subject",
"scope"
]
}
}
],
"@semantic-release/changelog",
"@semantic-release/npm",
[
"semantic-release-haxelib",
{
"haxelibPublish": true,
"additionalFiles": []
}
],
"@semantic-release/github",
[
"@semantic-release/git",
{
"assets": [
"dist/**/*.{js,css}",
"*.md",
"package.json",
"haxelib.json"
]
}
]
],
"preset": "angular"
}
31 changes: 15 additions & 16 deletions build.hxml
Original file line number Diff line number Diff line change
@@ -1,30 +1,29 @@
## JS
## JS (node)
-cp src
# -D dce=full
-D dce=no
-D js-es=6

-lib munit
-lib seedyrng
# DEFINES / MACROS
--macro include('', true, null, ['src'])

# OUTPUT
-js dist/js/index.js

--next
# --next

## C#
-cp src
-D dce=no
-D dll_import
-D no-root
-D dll

-lib seedyrng
# DEFINES / MACROS
# --macro addGlobalMetadata('*', '@:nativeGen')
--macro include('', true, null, ['src'])

# OUTPUT
-cs dist/cs/rules_engine
# -cp src
# -D dce=no
# -D dll_import
# -D no-root
# -D dll
#
# -lib seedyrng
# # DEFINES / MACROS
# # --macro addGlobalMetadata('*', '@:nativeGen')
# --macro include('', true, null, ['src'])
#
# # OUTPUT
# -cs dist/cs/langgen
19 changes: 13 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,25 @@
"author": "vantreeseba <[email protected]>",
"repository": "github:dropecho/langgen",
"main": "dist/js/index.js",
"browser": "dist/js/langgen.js",
"files": [
"dist/js/index.js"
],
"license": "MIT",
"scripts": {
"build": "haxe build.hxml",
"test": "haxelib run munit t",
"test-debug": "haxelib run munit t -debug",
"build-changelog": "conventional-changelog -i CHANGELOG.md -s -r 0",
"bump": "npm version --no-git-tag-version",
"haxe:submit": "haxelib run submit",
"version": "npm run build-changelog && npm run build",
"postversion": "git add . && git commit -m 'version' && npm run haxe:submit && npm publish"
"test-debug": "haxelib run munit t -debug"
},
"devDependencies": {
"@semantic-release/changelog": "^5.0.1",
"@semantic-release/commit-analyzer": "^8.0.1",
"@semantic-release/exec": "^5.0.0",
"@semantic-release/git": "^9.0.0",
"@semantic-release/github": "^7.0.7",
"@semantic-release/npm": "^7.0.5",
"@semantic-release/release-notes-generator": "^9.0.1",
"semantic-release": "^17.1.1",
"semantic-release-haxelib": "^0.3.1"
}
}
20 changes: 10 additions & 10 deletions test.hxml
Original file line number Diff line number Diff line change
Expand Up @@ -55,15 +55,15 @@
# -java build/java_test

# CSharp
--next
-main TestMain
-lib munit
-lib hamcrest
-lib seedyrng
-cp src

-cp test
-cs build/cs_test
# --next
# -main TestMain
# -lib munit
# -lib hamcrest
# -lib seedyrng
# -cp src
#
# -cp test
# -cs build/cs_test

# ## Python
# --next
Expand All @@ -87,7 +87,7 @@
# -php build/php_test

# ## JavaScript NodeJS
--next
# --next
-main TestMain
-lib munit
-lib hamcrest
Expand Down

0 comments on commit 8f191c6

Please sign in to comment.