Skip to content

Build: Linux / Check: Unit tests (mtests) #180

Build: Linux / Check: Unit tests (mtests)

Build: Linux / Check: Unit tests (mtests) #180

Workflow file for this run

name: 'Build: Linux / Check: Unit tests (mtests)'
on:
push:
branches:
- 3.x-worldwideweary
pull_request:
branches:
- 3.x-worldwideweary
schedule:
- cron: '0 4 */1 * *' # At 04:00 on every day-of-month
workflow_dispatch:
inputs:
build_mode:
description: 'Build mode: devel, nightly, testing, stable'
default: 'devel'
required: true
publish:
description: 'Publish to FTP: on - publish'
default: 'off'
required: false
workflow_call:
inputs:
build_mode:
description: 'Build mode: devel, nightly, testing, stable'
default: 'devel'
type: string
required: true
publish:
description: 'Publish to FTP: on - publish'
default: 'off'
type: string
env:
CURRENT_RELEASE_BRANCH: 3.x-worldwideweary
jobs:
linux_x64:
runs-on: ubuntu-20.04
steps:
- name: Cancel Previous Runs
uses: styfle/[email protected]
with:
access_token: ${{ github.token }}
- name: Clone repository
uses: actions/checkout@v4
- name: "Configure workflow"
env:
pull_request_title: ${{ github.event.pull_request.title }}
run: |
sudo bash ./build/ci/tools/make_build_mode_env.sh -e ${{ github.event_name }} -m ${{ inputs.build_mode }}
BUILD_MODE=$(cat ./build.artifacts/env/build_mode.env)
sudo bash ./build/ci/tools/make_build_number.sh
BUILD_NUMBER=$(cat ./build.artifacts/env/build_number.env)
DO_BUILD='true'
DO_PUBLISH='false'
if [[ "${{ inputs.publish }}" == "on" || "$BUILD_MODE" == "nightly" ]]; then
DO_PUBLISH='true'
if [ -z "${{ secrets.OSUOSL_SSH_ENCRYPT_SECRET }}" ]; then
echo "warning: not set OSUOSL_SSH_ENCRYPT_SECRET, publish disabled"
DO_PUBLISH='false'
fi
fi
ADD_INFO="_${GITHUB_REF#refs/heads/}"
if [ "${{ github.event_name }}" == "schedule" ] && [ "${{ github.event.schedule }}" == "0 5 */1 */1 *" ]; then ADD_INFO="_${CURRENT_RELEASE_BRANCH}"; fi
if [ "${{ github.event_name }}" == "pull_request" ]; then ADD_INFO="_${{ github.event.pull_request.number }}_${pull_request_title}"; fi
UPLOAD_ARTIFACT_NAME="$(tr '":<>|*?/\\?' '_' <<<"Mu3.7_${BUILD_NUMBER}_Lin${ADD_INFO}")"
echo "github.repository: ${{ github.repository }}"
echo "BUILD_MODE=$BUILD_MODE" >> $GITHUB_ENV
echo "BUILD_MODE: $BUILD_MODE"
echo "BUILD_NUMBER=$BUILD_NUMBER" >> $GITHUB_ENV
echo "BUILD_NUMBER: $BUILD_NUMBER"
echo "DO_BUILD=$DO_BUILD" >> $GITHUB_ENV
echo "DO_BUILD: $DO_BUILD"
echo "DO_PUBLISH=$DO_PUBLISH" >> $GITHUB_ENV
echo "DO_PUBLISH: $DO_PUBLISH"
echo "UPLOAD_ARTIFACT_NAME=$UPLOAD_ARTIFACT_NAME" >> $GITHUB_ENV
echo "UPLOAD_ARTIFACT_NAME: $UPLOAD_ARTIFACT_NAME"
- name: Setup environment
if: env.DO_BUILD == 'true'
run: |
sudo bash ./build/ci/linux/setup.sh
- name: Build
if: env.DO_BUILD == 'true'
run: |
T_ID=${{ secrets.TELEMETRY_TRACK_ID }}; if [ -z "$T_ID" ]; then T_ID="''"; fi
sudo bash ./build/ci/linux/build.sh -n ${{ github.run_id }} --telemetry $T_ID
- name: Package
if: env.DO_BUILD == 'true'
run: |
sudo bash ./build/ci/linux/package.sh
- name: Checksum
if: env.DO_BUILD == 'true'
run: |
sudo bash ./build/ci/tools/checksum.sh
- name: Publish package
if: env.DO_PUBLISH == 'true'
run: |
sudo bash ./build/ci/tools/osuosl/publish.sh -s ${{ secrets.OSUOSL_SSH_ENCRYPT_SECRET }} --os linux -v 3
- name: Upload artifacts on GitHub
if: env.DO_BUILD == 'true'
uses: actions/upload-artifact@v4
with:
name: ${{ env.UPLOAD_ARTIFACT_NAME }}
path: ./build.artifacts/
run_mtests:
runs-on: ubuntu-20.04
env:
# Enable AddressSanitizer in the mtest build
CFLAGS: "-fsanitize=address -fno-omit-frame-pointer"
CXXFLAGS: "-fsanitize=address -fno-omit-frame-pointer"
steps:
- name: Clone repository
uses: actions/checkout@v4
- name: Setup environment
run: |
sudo bash ./build/ci/linux/setup.sh
- name: Build
run: |
mkdir -p build.artifacts/env
#sudo bash ./build/ci/linux/build.sh -n ${{ github.run_id }} --build_mode mtests
./build/ci/linux/build.sh -n ${{ github.run_id }} --build_mode mtests
- name: Run mtests
run: |
# At moment build and run mtests consume 13.4 Gb of the disk.
# After left too little free space.
# So, we remove unnecessary tools, for more free space
sudo docker system prune -a -f
sudo rm -rf /usr/local/lib/android
#sudo bash ./build/ci/linux/runmtests.sh
./build/ci/linux/runmtests.sh