Skip to content

Commit dcba1f6

Browse files
Copilotwannaphong
andcommitted
Add GitHub Actions workflow for automated testing
Co-authored-by: wannaphong <8536487+wannaphong@users.noreply.github.com>
1 parent 975b625 commit dcba1f6

File tree

2 files changed

+60
-0
lines changed

2 files changed

+60
-0
lines changed

.github/workflows/test.yml

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
name: Build and Test
2+
3+
on:
4+
push:
5+
branches: [ main, dev, copilot/** ]
6+
pull_request:
7+
branches: [ main, dev ]
8+
9+
jobs:
10+
build-and-test:
11+
name: Build and Test on ${{ matrix.os }}
12+
runs-on: ${{ matrix.os }}
13+
strategy:
14+
fail-fast: false
15+
matrix:
16+
os: [ubuntu-latest, macos-latest]
17+
include:
18+
- os: ubuntu-latest
19+
cc: gcc
20+
- os: macos-latest
21+
cc: clang
22+
23+
steps:
24+
- name: Checkout code
25+
uses: actions/checkout@v4
26+
27+
- name: Display system information
28+
run: |
29+
echo "OS: ${{ matrix.os }}"
30+
echo "Compiler: ${{ matrix.cc }}"
31+
${{ matrix.cc }} --version
32+
make --version
33+
34+
- name: Build project
35+
run: |
36+
make clean
37+
make all
38+
env:
39+
CC: ${{ matrix.cc }}
40+
41+
- name: Run tests
42+
run: make test
43+
44+
- name: Test basic example
45+
run: |
46+
./build/example_basic "ฉันไปโรงเรียน" data/thai_words.txt
47+
./build/example_basic "วันนี้อากาศดีมาก" data/thai_words.txt
48+
./build/example_basic "hello world 123"
49+
50+
- name: Upload build artifacts
51+
if: failure()
52+
uses: actions/upload-artifact@v4
53+
with:
54+
name: build-artifacts-${{ matrix.os }}
55+
path: |
56+
build/
57+
lib/
58+
retention-days: 5

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# CThaiNLP
22

3+
![Build and Test](https://github.com/wannaphong/CThaiNLP/actions/workflows/test.yml/badge.svg)
4+
35
C implementation of Thai Natural Language Processing tools, ported from [PyThaiNLP](https://github.com/PyThaiNLP/pythainlp).
46

57
## Features

0 commit comments

Comments
 (0)