Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[CI] Github Action for lint, build and tests
- Loading branch information
1 parent
e7c842d
commit ab2fa6f
Showing
3 changed files
with
124 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,123 @@ | ||
name: CI tests | ||
|
||
defaults: | ||
run: | ||
shell: bash | ||
|
||
on: [push, pull_request] | ||
|
||
jobs: | ||
lint: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: "Path: ~/local/bin" | ||
run: echo ~/local/bin >> $GITHUB_PATH | ||
|
||
- name: Install luarocks | ||
run: curl -sSL "https://raw.githubusercontent.com/koreader/virdevenv/master/docker/ubuntu/baseimage/install_luarocks.sh" | sudo bash | ||
|
||
- name: Install Lint | ||
run: curl -sSL "https://raw.githubusercontent.com/koreader/virdevenv/master/docker/ubuntu/baseimage/install_lint.sh" | bash -s ~ | ||
|
||
- name: Check out Git repository | ||
uses: actions/checkout@v2 | ||
|
||
- name: lint | ||
run: source .ci/lint_script.sh | ||
|
||
emulator: | ||
name: ${{ matrix.name }} ${{ (contains(matrix.os, 'ubuntu-18.04') && '(ubuntu-18.04)') || '' }} | ||
runs-on: ${{ matrix.os }} | ||
continue-on-error: true | ||
env: | ||
EMULATE_READER: "1" | ||
CC: ${{ matrix.CC }} | ||
CXX: ${{ matrix.CXX }} | ||
|
||
steps: | ||
- name: KODEBUG | ||
if: contains(matrix.name, 'debug') | ||
run: echo "KODEBUG=1" >> $GITHUB_ENV | ||
|
||
- name: USE_MAKE | ||
if: contains(matrix.name, 'make') | ||
run: echo "USE_MAKE=1" >> $GITHUB_ENV | ||
|
||
- name: CLANG | ||
if: contains(matrix.name, 'clang') | ||
run: echo "CC=clang-12" >> $GITHUB_ENV && echo "Cxx=clang++-12" >> $GITHUB_ENV | ||
|
||
- name: Install deps | ||
run: sudo apt-get install gettext ccache ninja-build libtool-bin | ||
|
||
- name: Install luarocks | ||
run: curl -sSL "https://raw.githubusercontent.com/koreader/virdevenv/master/docker/ubuntu/baseimage/install_luarocks.sh" | sudo bash | ||
|
||
- name: Cache | ||
uses: actions/cache@v2 | ||
with: | ||
path: ~/.ccache | ||
key: ${{ matrix.os }}-build-${{ matrix.name }} | ||
|
||
- name: Check out Git repository | ||
uses: actions/checkout@v2 | ||
|
||
- name: fetchthirdparty | ||
run: make fetchthirdparty | ||
|
||
- name: Build | ||
run: make all | ||
|
||
- name: Test | ||
run: source .ci/test_script.sh | ||
strategy: | ||
matrix: | ||
os: [ubuntu-latest] | ||
name: [ emu_gcc_ninja, emu_gcc_ninja_debug, emu_gcc_make, emu_clang_ninja] | ||
# The test currently segfault on ubuntu 18.04. If fixed this can be enabled. | ||
#include: | ||
# - name: emu_gcc_ninja | ||
# os: ubuntu-18.04 | ||
|
||
xcompile: | ||
name: ${{ matrix.name }} | ||
runs-on: ubuntu-latest | ||
continue-on-error: true | ||
steps: | ||
- name: Download toolchain | ||
run: wget -q https://github.com/koreader/koxtoolchain/releases/latest/download/${{ matrix.name }}.zip && unzip -p ${{ matrix.name }}.zip | tar -C ~ -xz | ||
|
||
- name: export toolchain | ||
run: echo ~/x-tools/arm-${{ matrix.name }}-linux-gnueabi${{ matrix.toolchain }}/bin >> $GITHUB_PATH | ||
|
||
- name: Install deps | ||
run: sudo apt-get install gettext ccache ninja-build gcc-multilib luarocks | ||
|
||
- name: Cache | ||
uses: actions/cache@v2 | ||
with: | ||
path: ~/.ccache | ||
key: ${{ runner.os }}-build-${{ matrix.name }} | ||
|
||
- name: Check out Git repository | ||
uses: actions/checkout@v2 | ||
|
||
- name: fetchthirdparty | ||
run: make fetchthirdparty | ||
|
||
- name: Build | ||
run: make TARGET=${{ matrix.target || matrix.name }} all | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
name: [ cervantes, kindlepw2, pocketbook] | ||
include: | ||
- name: kindle | ||
target: kindle-legacy | ||
- name: kindle5 | ||
target: kindle | ||
- name: kobo | ||
toolchain: hf | ||
- name: remarkable | ||
toolchain: hf | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters