Skip to content

Commit 6f18402

Browse files
committed
added CI Workflows
1 parent 08f5f4d commit 6f18402

File tree

6 files changed

+135
-0
lines changed

6 files changed

+135
-0
lines changed

.arduino-ci.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
platforms:
2+
rpipico:
3+
board: rp2040:rp2040:rpipico
4+
package: rp2040:rp2040
5+
gcc:
6+
features:
7+
defines:
8+
- ARDUINO_ARCH_RP2040
9+
warnings:
10+
flags:
11+
12+
packages:
13+
rp2040:rp2040:
14+
url: https://github.com/earlephilhower/arduino-pico/releases/download/global/package_rp2040_index.json
15+
16+
libraries:
17+
- "SoftwareSerial"
18+
- "ArduinoJson"
19+
20+
compile:
21+
platforms:
22+
- uno
23+
# - m4
24+
# - esp32
25+
# - esp8266
26+
# - rpipico

.github/workflows/arduino-lint.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
name: Arduino-lint
2+
3+
on: [push, pull_request]
4+
jobs:
5+
lint:
6+
runs-on: ubuntu-latest
7+
steps:
8+
- uses: actions/checkout@v3
9+
- uses: arduino/arduino-lint-action@v1
10+
with:
11+
library-manager: update
12+
compliance: strict
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
---
2+
name: Arduino CI
3+
4+
on: [push, pull_request]
5+
6+
jobs:
7+
runTest:
8+
runs-on: ubuntu-latest
9+
10+
steps:
11+
- uses: actions/checkout@v3
12+
- uses: ruby/setup-ruby@v1
13+
with:
14+
ruby-version: 2.6
15+
- run: |
16+
gem install arduino_ci
17+
arduino_ci.rb

.github/workflows/jsoncheck.yml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
name: JSON check
2+
3+
on:
4+
push:
5+
paths:
6+
- '**.json'
7+
pull_request:
8+
9+
jobs:
10+
test:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v3
14+
- name: json-syntax-check
15+
uses: limitusus/json-syntax-check@v1
16+
with:
17+
pattern: "\\.json$"

README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
[![Arduino CI](https://github.com/ripred/MicroChess/workflows/Arduino%20CI/badge.svg)](https://github.com/marketplace/actions/arduino_ci)
2+
[![Arduino-lint](https://github.com/ripred/MicroChess/actions/workflows/arduino-lint.yml/badge.svg)](https://github.com/ripred/MicroChess/actions/workflows/arduino-lint.yml)
3+
![code size:](https://img.shields.io/github/languages/code-size/ripred/MicroChess)
4+
[![GitHub release](https://img.shields.io/github/release/ripred/MicroChess.svg?maxAge=3600)](https://github.com/ripred/MicroChess/releases)
5+
[![License: MIT](https://img.shields.io/badge/license-MIT-green.svg)](https://github.com/ripred/MicroChess/blob/master/LICENSE)
6+
17
# MicroChess
28
MicroChess is an embedded chess engine designed to run with only 2K of RAM and 32K of program flash, complete with en passant capture, castling, and quiescent searches.
39

test/unit_test_001.cpp

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
//
2+
// FILE: unit_test_001.cpp
3+
// AUTHOR: Trent M. Wyatt
4+
// DATE: 2024-01-04
5+
// PURPOSE: unit tests for ArduinoCLI library
6+
// https://github.com/RobTillaart/SIMON
7+
//
8+
9+
10+
// supported assertions
11+
// ----------------------------
12+
// assertEqual(expected, actual); // a == b
13+
// assertNotEqual(unwanted, actual); // a != b
14+
// assertComparativeEquivalent(expected, actual); // abs(a - b) == 0 or (!(a > b) && !(a < b))
15+
// assertComparativeNotEquivalent(unwanted, actual); // abs(a - b) > 0 or ((a > b) || (a < b))
16+
// assertLess(upperBound, actual); // a < b
17+
// assertMore(lowerBound, actual); // a > b
18+
// assertLessOrEqual(upperBound, actual); // a <= b
19+
// assertMoreOrEqual(lowerBound, actual); // a >= b
20+
// assertTrue(actual);
21+
// assertFalse(actual);
22+
// assertNull(actual);
23+
24+
// // special cases for floats
25+
// assertEqualFloat(expected, actual, epsilon); // fabs(a - b) <= epsilon
26+
// assertNotEqualFloat(unwanted, actual, epsilon); // fabs(a - b) >= epsilon
27+
// assertInfinity(actual); // isinf(a)
28+
// assertNotInfinity(actual); // !isinf(a)
29+
// assertNAN(arg); // isnan(a)
30+
// assertNotNAN(arg); // !isnan(a)
31+
32+
33+
#include <ArduinoUnitTests.h>
34+
35+
#include "Arduino.h"
36+
#include "MicroChess.h"
37+
38+
39+
unittest_setup()
40+
{
41+
fprintf(stderr, "MicroChess\n");
42+
}
43+
44+
45+
unittest_teardown()
46+
{
47+
}
48+
49+
50+
unittest(test_mock)
51+
{
52+
}
53+
54+
unittest_main()
55+
56+
// -- END OF FILE --
57+

0 commit comments

Comments
 (0)