tesseract/.github/workflows/sw.yml

74 lines
2.4 KiB
YAML
Raw Normal View History

2020-03-14 00:37:22 +08:00
name: sw
2020-01-06 08:18:47 +08:00
2021-01-10 19:58:30 +08:00
on:
push:
pull_request:
schedule:
# every day
- cron: 0 0 * * *
2020-01-06 08:18:47 +08:00
jobs:
2021-01-03 18:29:54 +08:00
build:
2020-01-06 08:18:47 +08:00
runs-on: ${{ matrix.os }}
strategy:
2020-03-30 06:53:41 +08:00
fail-fast: false
2020-01-06 08:18:47 +08:00
matrix:
2022-06-02 00:06:23 +08:00
os: [windows-2022, windows-2019, ubuntu-22.04, ubuntu-20.04, macOS-latest]
2020-01-06 08:18:47 +08:00
steps:
- uses: actions/checkout@v2
2021-01-03 08:01:22 +08:00
with:
submodules: recursive
2020-03-14 04:45:38 +08:00
- uses: egorpugin/sw-action@master
2020-01-06 08:18:47 +08:00
- name: build
2021-11-24 23:41:06 +08:00
if: matrix.os == 'windows-latest' || matrix.os == 'windows-2022'
2020-01-06 19:08:29 +08:00
run: ./sw -static -shared -platform x86,x64 -config d,r build
2020-03-14 00:37:22 +08:00
- name: build
2021-11-24 23:41:06 +08:00
if: matrix.os != 'windows-latest' && matrix.os != 'windows-2022'
run: ./sw -static -shared -config d,r build -Dwith-tests=1
2021-01-03 03:54:27 +08:00
- name: download test data
2021-01-06 02:32:42 +08:00
run: git clone https://github.com/egorpugin/tessdata tessdata_unittest
2021-01-06 02:32:42 +08:00
- name: copy fonts
2021-11-24 23:41:06 +08:00
if: matrix.os != 'windows-latest' && matrix.os != 'windows-2022'
2021-01-06 02:32:42 +08:00
run: cp tessdata_unittest/fonts/* test/testing/
2021-01-06 18:45:09 +08:00
- name: copy fonts
2021-11-24 23:41:06 +08:00
if: matrix.os == 'windows-latest' || matrix.os == 'windows-2022'
2021-01-06 18:45:09 +08:00
run: Copy-Item -Path "tessdata_unittest\fonts\*" -Destination "test\testing" -Recurse
shell: pwsh
- name: test
2021-11-24 23:41:06 +08:00
if: matrix.os != 'windows-latest' && matrix.os != 'windows-2022'
2021-01-03 21:58:35 +08:00
run: ./sw -static -shared -config "d,r" test -Dwith-tests=1 "-Dskip-tests=lstm,lstm_recode"
2021-01-04 08:43:11 +08:00
continue-on-error: true
2021-01-10 19:58:30 +08:00
- name: test-nightly
2021-11-24 23:41:06 +08:00
if: matrix.os != 'windows-latest' && matrix.os != 'windows-2022' && github.event.schedule=='0 0 * * *'
2021-01-10 19:58:30 +08:00
run: ./sw -static -shared -config "d,r" test -Dwith-tests=1
continue-on-error: true
2021-01-07 08:43:11 +08:00
# windows tests hang here for some reason, investigate
#- name: test
2021-11-24 23:41:06 +08:00
#if: matrix.os == 'windows-latest' || matrix.os == 'windows-2022'
2021-01-07 08:43:11 +08:00
#run: ./sw test -Dwith-tests=1 "-Dskip-tests=lstm,lstm_recode"
#continue-on-error: true
2021-01-06 07:08:24 +08:00
2021-01-03 07:50:59 +08:00
- name: Upload Unit Test Results
2021-11-24 23:41:06 +08:00
if: always() && matrix.os != 'windows-latest' && matrix.os != 'windows-2022'
2021-01-03 07:50:59 +08:00
uses: actions/upload-artifact@v2
with:
2021-01-04 18:57:24 +08:00
name: Test Results (${{ matrix.os }})
2021-01-03 07:50:59 +08:00
path: .sw/test/results.xml
2021-01-03 19:51:38 +08:00
- name: Publish Test Report
2021-11-24 23:41:06 +08:00
if: always() && matrix.os != 'windows-latest' && matrix.os != 'windows-2022'
2021-01-03 19:51:38 +08:00
uses: mikepenz/action-junit-report@v1
2021-01-03 19:36:46 +08:00
with:
2021-01-04 08:43:11 +08:00
check_name: test (${{ matrix.os }})
2021-01-03 19:51:38 +08:00
report_paths: .sw/test/results.xml
2021-01-03 19:36:46 +08:00
github_token: ${{ secrets.GITHUB_TOKEN }}