Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improved presentation + website #349

Open
wants to merge 20 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 33 additions & 0 deletions .github/workflows/gh-pages.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Deploy to GitHub Pages

on:
push:
branches:
- main

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2 # If you're using actions/checkout@v2 you must set persist-credentials to false in most cases for the deployment to work correctly.
with:
persist-credentials: false
- name: Use Node.js (Latest)
uses: actions/setup-node@v2
with:
node-version: "14"
check-latest: true
- name: Build
run: |
cd website
npm install -g @angular/cli
npm install
npm run build
cp dist/index.html dist/404.html
- name: Deploy
uses: JamesIves/github-pages-deploy-action@v4.2.5
with:
branch: gh-pages # The branch the action should deploy to.
folder: website/dist # The folder the action should deploy.
token: ${{ secrets.ACCESS_TOKEN }}
6 changes: 5 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,8 @@ data_*/

# Stub project
bin/
obj/
obj/

dist/

.vscode/
53 changes: 50 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,17 @@
# ![Icon](./icon.svg) WAT
![3.3.2](https://github.com/CodeDarigan/WAT-GDScript/workflows/%20%20Godot%203.3.2%20%20/badge.svg)
[![WAT Banner](images/banner.png)](https://alexdarigan.github.io/WAT/)

[![ko-fi](https://www.ko-fi.com/img/githubbutton_sm.svg)](https://ko-fi.com/Q5Q51D9K5)
# [WAT](https://alexdarigan.github.io/WAT/)
![3.3.2](https://github.com/CodeDarigan/WAT-GDScript/workflows/%20%20Godot%203.3.2%20%20/badge.svg) [![ko-fi](https://www.ko-fi.com/img/githubbutton_sm.svg)](https://ko-fi.com/Q5Q51D9K5)

A Godot unit-testing framework for GDScript and C#. It includes an inspector window for manually running tests, and a command-line interface for easy automated testing.

1. [Install](#Install)
2. [Project Settings](#ProjectSettings)
3. [GUI](#GUI)
4. [CLI](#CLI)
5. [Example Tests](#Examples)
6. [Assertions](#Assertions)
6. [Continuous Integration](#ContinuousIntegration)

## Install
<a name="Install"></a>
Expand Down Expand Up @@ -211,8 +214,52 @@ __Run on X Threads__
- [GDScript Assertions](/addons/WAT/assertions/assertions.gd)
- [C# Assertions](/addons/WAT/mono/assertions/Assertions.cs)

## Continuous Integration
<a name="ContinuousIntegration"></a>

You can automatically run your unit tests every time you push changes to your game's repository. Here's some automation templates for popular git hosting services.

**Github**

Paste the stuff below into `.github/workflows/tests.yml`

```yaml
name: 🧪 Run Unit Tests

on: [push, pull_request]

env:
IMPORT_TIME: 10s # Controls how long we wait to import our assets

jobs:
Tests:
name: Run All Tests on 3.5
runs-on: ubuntu-latest
container: barichello/godot-ci:mono-3.5
steps:
- name: Checkout Repository
uses: actions/checkout@v3
with:
submodules: recursive

- name: Install Dependencies
run: |
nuget restore
mkdir -p .mono/assemblies/Debug
cp /usr/local/bin/GodotSharp/Api/Release/* .mono/assemblies/Debug
- name: Compile
run: msbuild

- name: Reimport Assets
run: timeout $IMPORT_TIME godot --editor || code=$?; if [[ $code -ne 124 && $code -ne 0 ]]; then exit $code; fi

- name: Run
run: godot addons/WAT/cli.tscn run=all

- name: Upload Test Results
if: always()
uses: actions/upload-artifact@v2
with:
name: Test Results
path: tests/results.xml
```
Empty file added StubProj/.gdignore
Empty file.
Binary file added images/banner.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
35 changes: 35 additions & 0 deletions images/banner.png.import
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
[remap]

importer="texture"
type="StreamTexture"
path="res://.import/banner.png-495447ee2000b5377e44fe44842d6fba.stex"
metadata={
"vram_texture": false
}

[deps]

source_file="res://images/banner.png"
dest_files=[ "res://.import/banner.png-495447ee2000b5377e44fe44842d6fba.stex" ]

[params]

compress/mode=0
compress/lossy_quality=0.7
compress/hdr_mode=0
compress/bptc_ldr=0
compress/normal_map=0
flags/repeat=0
flags/filter=true
flags/mipmaps=false
flags/anisotropic=false
flags/srgb=2
process/fix_alpha_border=true
process/premult_alpha=false
process/HDR_as_SRGB=false
process/invert_color=false
process/normal_map_invert_y=false
stream=false
size_limit=0
detect_3d=true
svg/scale=1.0
16 changes: 16 additions & 0 deletions website/.browserslistrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# This file is used by the build system to adjust CSS and JS output to support the specified browsers below.
# For additional information regarding the format and rule options, please see:
# https://github.com/browserslist/browserslist#queries

# For the full list of supported browsers by the Angular framework, please see:
# https://angular.io/guide/browser-support

# You can see what browsers were selected by your queries by running:
# npx browserslist

last 1 Chrome version
last 1 Firefox version
last 2 Edge major versions
last 2 Safari major versions
last 2 iOS major versions
Firefox ESR
16 changes: 16 additions & 0 deletions website/.editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Editor configuration, see https://editorconfig.org
root = true

[*]
charset = utf-8
indent_style = space
indent_size = 2
insert_final_newline = true
trim_trailing_whitespace = true

[*.ts]
quote_type = single

[*.md]
max_line_length = off
trim_trailing_whitespace = false
Empty file added website/.gdignore
Empty file.
42 changes: 42 additions & 0 deletions website/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# See http://help.github.com/ignore-files/ for more about ignoring files.

# Compiled output
/dist
/tmp
/out-tsc
/bazel-out

# Node
/node_modules
npm-debug.log
yarn-error.log

# IDEs and editors
.idea/
.project
.classpath
.c9/
*.launch
.settings/
*.sublime-workspace

# Visual Studio Code
.vscode/*
!.vscode/settings.json
!.vscode/tasks.json
!.vscode/launch.json
!.vscode/extensions.json
.history/*

# Miscellaneous
/.angular/cache
.sass-cache/
/connect.lock
/coverage
/libpeerconnection.log
testem.log
/typings

# System files
.DS_Store
Thumbs.db
7 changes: 7 additions & 0 deletions website/.prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"singleQuote": true,
"trailingComma": "all",
"tabWidth": 2,
"semi": true,
"printWidth": 120
}
27 changes: 27 additions & 0 deletions website/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# WatWebsite

This project was generated with [Angular CLI](https://github.com/angular/angular-cli) version 14.0.3.

## Development server

Run `ng serve` for a dev server. Navigate to `http://localhost:4200/`. The application will automatically reload if you change any of the source files.

## Code scaffolding

Run `ng generate component component-name` to generate a new component. You can also use `ng generate directive|pipe|service|class|guard|interface|enum|module`.

## Build

Run `ng build` to build the project. The build artifacts will be stored in the `dist/` directory.

## Running unit tests

Run `ng test` to execute the unit tests via [Karma](https://karma-runner.github.io).

## Running end-to-end tests

Run `ng e2e` to execute the end-to-end tests via a platform of your choice. To use this command, you need to first add a package that implements end-to-end testing capabilities.

## Further help

To get more help on the Angular CLI use `ng help` or go check out the [Angular CLI Overview and Command Reference](https://angular.io/cli) page.
126 changes: 126 additions & 0 deletions website/angular.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,126 @@
{
"$schema": "./node_modules/@angular/cli/lib/config/schema.json",
"version": 1,
"newProjectRoot": "projects",
"projects": {
"wat-website": {
"projectType": "application",
"schematics": {
"@schematics/angular:component": {
"style": "scss"
}
},
"root": "",
"sourceRoot": "src",
"prefix": "app",
"architect": {
"build": {
"builder": "@angular-devkit/build-angular:browser",
"options": {
"outputPath": "dist",
"index": "src/index.html",
"main": "src/main.ts",
"polyfills": "src/polyfills.ts",
"tsConfig": "tsconfig.app.json",
"inlineStyleLanguage": "scss",
"assets": [
"src/favicon.ico",
"src/assets"
],
"styles": [
"src/styles.scss",
{
"inject": false,
"input": "src/styles/themes/dark.scss",
"bundleName": "dark"
},
{
"inject": false,
"input": "src/styles/themes/light.scss",
"bundleName": "light"
}
],
"stylePreprocessorOptions": {
"includePaths": [
"src/",
"src/styles",
"src/components",
"src/pages"
]
},
"scripts": []
},
"configurations": {
"production": {
"baseHref": "/WAT/",
"budgets": [
{
"type": "initial",
"maximumWarning": "500kb",
"maximumError": "1mb"
},
{
"type": "anyComponentStyle",
"maximumWarning": "2kb",
"maximumError": "4kb"
}
],
"fileReplacements": [
{
"replace": "src/environments/environment.ts",
"with": "src/environments/environment.prod.ts"
}
],
"outputHashing": "all"
},
"development": {
"buildOptimizer": false,
"optimization": false,
"vendorChunk": true,
"extractLicenses": false,
"sourceMap": true,
"namedChunks": true
}
},
"defaultConfiguration": "production"
},
"serve": {
"builder": "@angular-devkit/build-angular:dev-server",
"configurations": {
"production": {
"browserTarget": "wat-website:build:production"
},
"development": {
"browserTarget": "wat-website:build:development"
}
},
"defaultConfiguration": "development"
},
"extract-i18n": {
"builder": "@angular-devkit/build-angular:extract-i18n",
"options": {
"browserTarget": "wat-website:build"
}
},
"test": {
"builder": "@angular-devkit/build-angular:karma",
"options": {
"main": "src/test.ts",
"polyfills": "src/polyfills.ts",
"tsConfig": "tsconfig.spec.json",
"karmaConfig": "karma.conf.js",
"inlineStyleLanguage": "scss",
"assets": [
"src/favicon.ico",
"src/assets"
],
"styles": [
"src/styles.scss"
],
"scripts": []
}
}
}
}
}
}
Loading