Skip to content

Commit

Permalink
Adapt CI Linux compilation to new containers
Browse files Browse the repository at this point in the history
  • Loading branch information
kelson42 committed Mar 16, 2023
1 parent 9da94e9 commit d72628e
Showing 1 changed file with 32 additions and 30 deletions.
62 changes: 32 additions & 30 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -142,69 +142,71 @@ jobs:
lib_postfix: '64'
env:
HOME: /home/runner
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
container:
image: "kiwix/kiwix-build_ci:${{matrix.image_variant}}-32"
image: "ghcr.io/kiwix/kiwix-build_ci_${{matrix.image_variant}}:33"

steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Install deps
- name: Install dependences
if: false == startsWith(matrix.target, 'alpine_')
shell: bash
run: |
ARCHIVE_NAME=deps2_${OS_NAME}_${{matrix.target}}_libzim.tar.xz
wget -O- http://tmp.kiwix.org/ci/${ARCHIVE_NAME} | tar -xJ -C /home/runner
wget -O- http://tmp.kiwix.org/ci/${ARCHIVE_NAME} | tar -xJ -C ${{env.HOME}}
- name: Compile
- name: Retrieve source code
uses: actions/checkout@v3

- name: Compile source code
shell: bash
env:
PKG_CONFIG_PATH: ${{env.HOME}}/BUILD_${{matrix.target}}/INSTALL/lib/pkgconfig:${{env.HOME}}/BUILD_${{matrix.target}}/INSTALL/lib${{matrix.lib_postfix}}/pkgconfig
run: |
if [[ "${{matrix.target}}" =~ .*_dyn ]]; then
if [[ "${{matrix.target}}" =~ .*_dyn ]]
then
MESON_OPTION="--default-library=shared"
else
MESON_OPTION="--default-library=static"
fi
if [[ "${{matrix.target}}" =~ native_.* ]]; then
if [[ "${{matrix.target}}" =~ native_.* ]]
then
MESON_OPTION="$MESON_OPTION -Db_coverage=true"
elif [[ "${{matrix.target}}" != alpine_* ]]; then
MESON_OPTION="$MESON_OPTION --cross-file $HOME/BUILD_${{matrix.target}}/meson_cross_file.txt"
elif [[ "${{matrix.target}}" != alpine_* ]]
then
MESON_OPTION="$MESON_OPTION --cross-file ${{ env.HOME }}/BUILD_${{ matrix.target }}/meson_cross_file.txt"
fi
if [[ "${{matrix.target}}" =~ android_.* ]]; then
if [[ "${{matrix.target}}" =~ android_.* ]]
then
MESON_OPTION="$MESON_OPTION -Dstatic-linkage=true -DUSE_BUFFER_HEADER=false"
fi
if [[ "${{matrix.target}}" == wasm ]]; then
if [[ "${{matrix.target}}" == wasm ]]
then
MESON_OPTION="$MESON_OPTION -Dexamples=false"
fi
cd $HOME/libzim
meson . build ${MESON_OPTION} -Dwith_xapian=${{matrix.with_xapian}}
cd build
ninja
env:
PKG_CONFIG_PATH: "/home/runner/BUILD_${{matrix.target}}/INSTALL/lib/pkgconfig:/home/runner/BUILD_${{matrix.target}}/INSTALL/lib${{matrix.lib_postfix}}/pkgconfig"
- name: Test
if: startsWith(matrix.target, 'native_') || startsWith(matrix.target, 'alpine_')
- name: Run automated tests
shell: bash
if: startsWith(matrix.target, 'native_') || startsWith(matrix.target, 'alpine_')
env:
LD_LIBRARY_PATH: "${{env.HOME}}/BUILD_${{matrix.target}}/INSTALL/lib:${{env.HOME}}/BUILD_${{matrix.target}}/INSTALL/lib${{matrix.lib_postfix}}"
SKIP_BIG_MEMORY_TEST: 1
WAIT_TIME_FACTOR_TEST: 10
run: |
cd $HOME/libzim/build
cd build
ninja download_test_data
meson test --verbose
if [[ "${{matrix.target}}" =~ native_.* ]]; then
ninja coverage
fi
env:
LD_LIBRARY_PATH: "/home/runner/BUILD_${{matrix.target}}/INSTALL/lib:/home/runner/BUILD_${{matrix.target}}/INSTALL/lib${{matrix.lib_postfix}}"
SKIP_BIG_MEMORY_TEST: 1
WAIT_TIME_FACTOR_TEST: 10
- name: Publish coverage
- name: Upload code coverage
shell: bash
if: startsWith(matrix.target, 'native_')
env:
CODECOV_TOKEN: ${{secrets.CODECOV_TOKEN}}
run: |
cd $HOME/libzim
curl https://codecov.io/bash -o codecov.sh
bash codecov.sh -n "${OS_NAME}_${{matrix.target}}" -Z
rm codecov.sh
if: startsWith(matrix.target, 'native_')
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}

0 comments on commit d72628e

Please sign in to comment.