name: Build and test Qbs on: [push] jobs: build-linux: name: ${{ matrix.config.name }} runs-on: ubuntu-latest timeout-minutes: 45 strategy: fail-fast: false matrix: config: - { name: 'Build on Linux (gcc)', options: 'modules.cpp.compilerWrapper:ccache modules.qbs.debugInformation:true modules.qbsbuildconfig.enableBundledQt:true products.qbs_archive.targetName:qbs-linux-${{ github.run_id }} products.qbs_archive.includeTests:true', script: './scripts/build-qbs-with-qbs.sh', cacheid: 'gcc', } env: BUILD_OPTIONS: ${{ matrix.config.options }} WITH_TESTS: 0 steps: - uses: actions/checkout@v1 - name: Create .ccache dir run: mkdir -p ~/.ccache - name: prepare timestamp id: get-timestamp run: echo ::set-output name=timestamp::$(date -u +"%Y-%m-%dT%H:%M:%SZ") - name: ccache cache files uses: actions/cache@v2 with: path: ~/.ccache key: ${{ runner.os }}-${{ matrix.config.cacheid }}-ccache-${{ steps.get-timestamp.outputs.timestamp }} restore-keys: ${{ runner.os }}-${{ matrix.config.cacheid }}-ccache- - name: Pull the Focal Image run: docker-compose pull focal - name: Print ccache stats run: docker-compose run focal ccache -s - name: Build Qbs run: docker-compose run focal ${{ matrix.config.script }} - name: Print ccache stats run: docker-compose run focal ccache -s - name: Upload artifacts uses: 'actions/upload-artifact@v2' with: name: qbs-linux-${{ github.run_id }}.tar.gz path: release/qbs-linux-${{ github.run_id }}.tar.gz build-linux-extra: name: ${{ matrix.config.name }} runs-on: ubuntu-latest timeout-minutes: 45 strategy: fail-fast: false matrix: config: - { name: 'Build on Linux (clang_tidy)', script: './scripts/run-analyzer.sh', options: 'profile:qt-clang_64 modules.cpp.compilerWrapper:ccache', cacheid: 'clang', } - { name: 'Build on Linux (CMake)', script: './scripts/build-qbs-with-cmake.sh', cacheid: 'cmake', } - { name: 'Build on Linux (QMake)', script: './scripts/build-qbs-with-qmake.sh', options: 'CONFIG+=ccache', cacheid: 'qmake', } env: BUILD_OPTIONS: ${{ matrix.config.options }} QTEST_FUNCTION_TIMEOUT: 9000000 steps: - uses: actions/checkout@v1 - name: Create .ccache dir run: mkdir -p ~/.ccache - name: prepare timestamp id: get-timestamp run: echo ::set-output name=timestamp::$(date -u +"%Y-%m-%dT%H:%M:%SZ") - name: ccache cache files uses: actions/cache@v2 with: path: ~/.ccache key: ${{ runner.os }}-${{ matrix.config.cacheid }}-ccache-${{ steps.get-timestamp.outputs.timestamp }} restore-keys: ${{ runner.os }}-${{ matrix.config.cacheid }}-ccache- - name: Pull the Focal Image run: docker-compose pull focal - name: Print ccache stats run: docker-compose run focal ccache -s - name: Build Qbs run: docker-compose run focal ${{ matrix.config.script }} - name: Print ccache stats run: docker-compose run focal ccache -s build-macos: name: Build on macOS runs-on: macos-latest timeout-minutes: 45 env: BUILD_OPTIONS: | modules.cpp.compilerWrapper:ccache modules.qbs.debugInformation:true modules.qbsbuildconfig.enableAddressSanitizer:false modules.qbsbuildconfig.enableBundledQt:true products.qbs_archive.targetName:qbs-macos-${{ github.run_id }} products.qbs_archive.includeTests:true WITH_TESTS: 0 steps: - uses: actions/checkout@v1 - name: Create .ccache dir run: mkdir -p ~/.ccache - name: prepare timestamp id: get-timestamp run: echo ::set-output name=timestamp::$(date -u +"%Y-%m-%dT%H:%M:%SZ") - name: ccache cache files uses: actions/cache@v2 with: path: ~/.ccache key: ${{ runner.os }}-ccache-${{ steps.get-timestamp.outputs.timestamp }} restore-keys: ${{ runner.os }}-ccache- - name: Install required packages run: | brew install ccache p7zip python3 -m pip install --user beautifulsoup4 lxml - name: Install Qt uses: ./.github/actions/download-qt with: toolchain: clang_64 - name: Install Qt Creator uses: ./.github/actions/download-qtc with: version: 4.13.2 - name: Setup Qbs run: | qbs setup-toolchains --detect qbs setup-qt --detect qbs config profiles.qt.baseProfile xcode-macosx-x86_64 qbs config defaultProfile qt qbs config --list - name: Print ccache stats run: ccache -s - name: Build Qbs run: scripts/build-qbs-with-qbs.sh - name: Print ccache stats run: ccache -s - name: Upload artifacts uses: 'actions/upload-artifact@v2' with: name: qbs-macos-${{ github.run_id }}.tar.gz path: release/qbs-macos-${{ github.run_id }}.tar.gz build-windows: name: Build on Windows runs-on: windows-latest timeout-minutes: 45 env: BUILD_OPTIONS: | modules.cpp.compilerWrapper:clcache modules.qbsbuildconfig.enableAddressSanitizer:false modules.qbsbuildconfig.enableBundledQt:true products.qbs_archive.targetName:qbs-windows-${{ github.run_id }} products.qbs_archive.includeTests:true, WITH_TESTS: 0 QT_ASSUME_STDERR_HAS_CONSOLE: 1 steps: - uses: actions/checkout@v1 - name: prepare timestamp id: get-timestamp run: echo ::set-output name=timestamp::$(date -u +"%Y-%m-%dT%H:%M:%SZ") shell: bash - name: clcache cache files uses: actions/cache@v2 with: path: ~/clcache key: ${{ runner.os }}-msvc-clcache-${{ steps.get-timestamp.outputs.timestamp }} restore-keys: ${{ runner.os }}-msvc-clcache- - name: Set up Python ${{ matrix.python-version }} uses: actions/setup-python@v2 with: python-version: 3.8 - name: Install required packages run: | python -m pip install --upgrade pip pip install beautifulsoup4 lxml pip install git+https://github.com/frerich/clcache.git@cae73d8255d78db8ba11e23c51fd2c9a89e7475b - name: Install Qt uses: ./.github/actions/download-qt with: toolchain: win64_msvc2019_64 - name: Install Qt Creator uses: ./.github/actions/download-qtc - name: Setup Qbs run: | qbs setup-toolchains --detect qbs setup-qt $(which qmake).exe qt qbs config defaultProfile qt qbs config --list shell: bash - name: Print clcache stats run: clcache -s - name: Build Qbs run: scripts/build-qbs-with-qbs.sh shell: bash - name: Print clcache stats run: clcache -s - name: Upload artifacts uses: 'actions/upload-artifact@v2' with: name: qbs-windows-${{ github.run_id }}.zip path: release/qbs-windows-${{ github.run_id }}.zip test-linux: name: ${{ matrix.config.name }} runs-on: ubuntu-latest timeout-minutes: 45 needs: build-linux strategy: fail-fast: false matrix: config: - { name: 'Run Linux tests (gcc)', image: 'focal', profile: 'qt-gcc_64', script: './scripts/test-qbs.sh', } - { name: 'Run Linux tests (clang)', image: 'focal', profile: 'qt-clang_64', script: './scripts/test-qbs.sh', } - { name: 'Run Android tests (Qt 5.13)', image: 'focal-android-513', profile: '', script: './scripts/test-qt-for-android.sh', } - { name: 'Run Android tests (Qt 5.14)', image: 'focal-android-514', profile: '', script: './scripts/test-qt-for-android.sh', } - { name: 'Run Android tests (Qt 5.15)', image: 'focal-android-515', profile: '', script: './scripts/test-qt-for-android.sh', } - { name: 'Run Linux tests (Qt 4.8.7)', image: 'focal-qt4', profile: '', script: './scripts/test-qt4.sh', } env: QBS_TEST_SOURCE_ROOT: 'tests' QBS_AUTOTEST_PROFILE: ${{ matrix.config.profile }} QTEST_FUNCTION_TIMEOUT: 9000000 steps: - uses: actions/checkout@v1 - name: Download artifact uses: actions/download-artifact@v1 with: name: qbs-linux-${{ github.run_id }}.tar.gz path: ./ - name: Unpack artifact run: mkdir -p release/install-root/ && tar xzf qbs-linux-${{ github.run_id }}.tar.gz -C release/install-root/ - name: Pull the Docker Image run: docker-compose pull ${{ matrix.config.image }} - name: Run tests run: docker-compose run ${{ matrix.config.image }} ${{ matrix.config.script }} release/install-root/usr/local/bin test-baremetal: name: Run Baremetal tests runs-on: ubuntu-latest timeout-minutes: 45 needs: build-linux env: QBS_TEST_SOURCE_ROOT: 'tests' steps: - uses: actions/checkout@v1 - name: Download artifact uses: actions/download-artifact@v1 with: name: qbs-linux-${{ github.run_id }}.tar.gz path: ./ - name: Unpack artifact run: mkdir -p release/install-root/ && tar xzf qbs-linux-${{ github.run_id }}.tar.gz -C release/install-root/ - name: Pull the Focal-Baremetal Image run: docker-compose pull focal-baremetal - name: arm-none-eabi-gcc-9_2 run: QBS_AUTOTEST_PROFILE=arm-none-eabi-gcc-9_2 docker-compose run focal-baremetal scripts/test-baremetal.sh release/install-root/usr/local/bin - name: avr-gcc-5_4 run: QBS_AUTOTEST_PROFILE=avr-gcc-5_4 docker-compose run focal-baremetal scripts/test-baremetal.sh release/install-root/usr/local/bin - name: msp430-gcc-4_6 run: QBS_AUTOTEST_PROFILE=msp430-gcc-4_6 docker-compose run focal-baremetal scripts/test-baremetal.sh release/install-root/usr/local/bin - name: sdcc-3_8_0-mcs51 run: QBS_AUTOTEST_PROFILE=sdcc-3_8_0-mcs51 docker-compose run focal-baremetal scripts/test-baremetal.sh release/install-root/usr/local/bin - name: sdcc-3_8_0-stm8 run: QBS_AUTOTEST_PROFILE=sdcc-3_8_0-stm8 docker-compose run focal-baremetal scripts/test-baremetal.sh release/install-root/usr/local/bin test-macos: name: ${{ matrix.config.name }} runs-on: macos-latest timeout-minutes: 45 needs: build-macos env: QTEST_FUNCTION_TIMEOUT: 9000000 QBS_AUTOTEST_PROFILE: 'qt' QBS_TEST_SOURCE_ROOT: 'tests' strategy: fail-fast: false matrix: config: - { name: 'Run macOS tests (Xcode 12.0)', target: 'desktop', toolchain: 'clang_64', testProfile: 'xcode_12-macosx-x86_64', } - { name: 'Run macOS tests (Xcode 11.6)', target: 'desktop', toolchain: 'clang_64', testProfile: 'xcode_11_6-macosx-x86_64', } - { name: 'Run macOS tests (Xcode 10.3)', target: 'desktop', toolchain: 'clang_64', testProfile: 'xcode_10_3-macosx-x86_64', } - { name: 'Run iOS tests (Xcode 12.0)', target: 'ios', toolchain: 'ios', testProfile: 'xcode_12-iphoneos-arm64', } - { name: 'Run iOS-sim tests (Xcode 12.0)', target: 'ios', toolchain: 'ios', testProfile: 'xcode_12-iphonesimulator-x86_64', } steps: - uses: actions/checkout@v1 - name: Download artifact uses: actions/download-artifact@v1 with: name: qbs-macos-${{ github.run_id }}.tar.gz path: ./ - name: Unpack artifact run: mkdir -p release/install-root/ && tar xzf qbs-macos-${{ github.run_id }}.tar.gz -C release/install-root/ - name: Update PATH run: echo "./release/install-root/usr/local/bin" >> $GITHUB_PATH - name: Install required packages run: brew install capnp ccache grpc icoutils makensis protobuf p7zip - name: Install Qt uses: ./.github/actions/download-qt with: target: ${{ matrix.config.target }} toolchain: ${{ matrix.config.toolchain }} - name: Setup Qbs run: | qbs setup-toolchains --detect qbs setup-qt --detect qbs config profiles.qt.baseProfile ${{ matrix.config.testProfile }} qbs config defaultProfile qt qbs config --list - name: Run Tests run: ./scripts/test-qbs.sh ./release/install-root/usr/local/bin test-windows: name: ${{ matrix.config.name }} runs-on: windows-latest timeout-minutes: 45 needs: build-windows strategy: fail-fast: false matrix: config: - { name: 'Run Windows tests (MSVC 2019)', target: 'desktop', toolchain: 'win64_msvc2019_64', testProfile: 'MSVC2019-x64', } - { name: 'Run Windows tests (clang-cl)', target: 'desktop', toolchain: 'win64_msvc2019_64', testProfile: 'clang-cl-x86_64', } env: QTEST_FUNCTION_TIMEOUT: 9000000 QBS_AUTOTEST_PROFILE: 'qt' QBS_TEST_SOURCE_ROOT: 'tests' QT_ASSUME_STDERR_HAS_CONSOLE: 1 steps: - uses: actions/checkout@v1 - name: Download artifact uses: actions/download-artifact@v1 with: name: qbs-windows-${{ github.run_id }}.zip path: ./ - name: Unpack artifact run: | mkdir -p release/install-root cd release/install-root 7z x ../../qbs-windows-${{ github.run_id }}.zip shell: bash - name: Update PATH run: echo "./release/install-root/bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append - name: Install required packages run: choco install -y pkgconfiglite - name: Install Qt uses: ./.github/actions/download-qt with: toolchain: ${{ matrix.config.toolchain }} - name: Setup Qbs run: | qbs setup-toolchains --detect qbs setup-qt $(which qmake).exe qt qbs config profiles.qt.baseProfile ${{ matrix.config.testProfile }} qbs config defaultProfile qt qbs config --list shell: bash - name: Run Tests run: ./scripts/test-qbs.sh ./release/install-root/bin shell: bash