Skip to content

CI

CI #11089

Workflow file for this run

# This is a basic workflow to help you get started with Actions
name: CI
# Controls when the action will run. Triggers the workflow on push or pull request
# events but only for the main branch
on:
schedule:
- cron: '0 10 * * *'
push:
branches:
- '**'
workflow_dispatch: {}
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
generate-matrix:
name: Generate Job Matrix
runs-on: ubuntu-20.04
outputs:
matrixLinux: ${{ steps.set-matrix.outputs.matrixLinux }}
matrixBSD: ${{ steps.set-matrix.outputs.matrixBSD }}
steps:
- uses: actions/checkout@v3
- name: Checkout CCI
uses: actions/checkout@v3
with:
repository: conan-io/conan-center-index
path: CCI
- uses: actions/setup-python@v4
with:
python-version: "3.8"
cache: 'pip' # caching pip dependencies
- run: python3 -m pip install -r requirements.txt
- name: Generate Job Matrix
id: set-matrix
run: |
python3 main.py
MATRIXLINUX=$(cat matrixLinux.yml)
echo "${MATRIXLINUX}"
echo "matrixLinux=${MATRIXLINUX}" >> $GITHUB_OUTPUT
MATRIXBSD=$(cat matrixBSD.yml)
echo "${MATRIXBSD}"
echo "matrixBSD=${MATRIXBSD}" >> $GITHUB_OUTPUT
FreeBSD:
if: ${{ true }}
needs: generate-matrix
strategy:
fail-fast: false
matrix: ${{fromJson(needs.generate-matrix.outputs.matrixBSD)}}
runs-on: macos-12
env:
CC: clang
CXX: clang++
CONAN_SYSREQUIRES_MODE: enabled
steps:
- name: Checkout CCI
uses: actions/checkout@v3
with:
repository: ${{ matrix.repo }}
ref: ${{ matrix.ref }}
path: CCI
- name: run
id: test
uses: vmactions/freebsd-vm@v0
with:
envs: 'CONAN_MAKE_PROGRAM CC CXX CONAN_SYSREQUIRES_MODE'
usesh: true
prepare: pkg install -y cmake py39-pip py39-sqlite3 sudo pkgconf
run: |
python3.9 -m pip install conan distro
code=0
set +o pipefail
conan profile detect
conan create CCI/recipes/${{ matrix.package }}/${{ matrix.folder }} --version system -c tools.system.package_manager:mode=install || code=$?
filename=artifact_FreeBSD_${{ matrix.job_id }}.yml
echo job_id: ${{ matrix.job_id }} > ${filename}
echo package: ${{ matrix.package }} >> ${filename}
echo pr: ${{ matrix.pr }} >> ${filename}
echo distro: FreeBSD >> ${filename}
echo res: $code >> ${filename}
if [ $code == 6 ]
then
code=0
fi
exit "$code"
- uses: actions/upload-artifact@v3
if: ${{ always() }}
with:
name: my-artifact
path: artifact_*.yml
Linux:
if: ${{ true }}
needs: generate-matrix
strategy:
fail-fast: false
matrix: ${{fromJson(needs.generate-matrix.outputs.matrixLinux)}}
runs-on: ubuntu-20.04
container: ${{ matrix.distro }}
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
- name: Install Python
env:
DEBIAN_FRONTEND: noninteractive
run: |
case ${{ matrix.distro }} in
opensuse*)
zypper --non-interactive install python3 python3-pip python3-setuptools python3-wheel tar gzip pkg-config gcc-c++ make;;
debian*)
apt-get update && apt-get -qq install -y --no-install-recommends python3-pip python3-setuptools pkg-config g++ make;;
ubuntu*)
apt-get update && apt-get -qq install -y --no-install-recommends python3-pip python3-setuptools pkg-config g++ make;;
quay.io/centos/centos:stream8)
yum -y install dnf-plugins-core && yum config-manager --set-enabled powertools && yum install -y python3 python3-pip pkgconf-pkg-config gcc-c++ make;;
quay.io/centos/centos:stream9)
yum -y install dnf-plugins-core && yum config-manager --set-enabled crb && yum install -y python3 python3-pip pkgconf-pkg-config gcc-c++ make;;
almalinux:8*)
yum -y install dnf-plugins-core && yum config-manager --set-enabled powertools && yum install -y epel-release && yum install -y python3 python3-wheel python3-pip pkgconf-pkg-config gcc-c++ make;;
almalinux:9*)
yum -y install dnf-plugins-core && yum config-manager --set-enabled crb && yum install -y epel-release && yum install -y python3 python3-wheel python3-pip pkgconf-pkg-config gcc-c++ make;;
archlinux*)
pacman -Syu --noconfirm python-pip gcc pkgconf gcc make;;
fedora*)
dnf -y install python3 python3-wheel python3-pip pkgconf-pkg-config gcc-c++ make;;
esac
- name: install conan
run: python3 -m pip install --upgrade pip && python3 -m pip install conan distro cmake --ignore-installed
- name: Checkout CCI
uses: actions/checkout@v3
with:
repository: ${{ matrix.repo }}
ref: ${{ matrix.ref }}
path: CCI
- name: run
shell: bash
env:
CONAN_SYSREQUIRES_MODE: enabled
CONAN_SYSREQUIRES_SUDO: 0
DEBIAN_FRONTEND: noninteractive
run: |
conan profile detect
# conan config install ${GITHUB_SERVER_URL}/${{ github.repository }}/archive/${{ github.sha }}.zip -sf=system-packages-checks-${{ github.sha }}/config
# conan install --tool-requires cmake/3.25.2@ -g VirtualBuildEnv -s:b compiler=gcc -s:b compiler.version=11 -s:b compiler.libcxx=libstdc++11
# source ./conanbuild.sh
code=0
set +o pipefail
conan create CCI/recipes/${{ matrix.package }}/${{ matrix.folder }} --version system -c tools.system.package_manager:mode=install || code=$?
distro=${{ matrix.distro }}
distro=${distro////_}
distro=${distro//:/_}
filename=artifact_${distro}_${{ matrix.job_id }}.yml
echo job_id: ${{ matrix.job_id }} > ${filename}
echo package: ${{ matrix.package }} >> ${filename}
echo pr: ${{ matrix.pr }} >> ${filename}
echo distro: "${{ matrix.distro }}" >> ${filename}
echo res: $code >> ${filename}
if [ $code == 6 ]
then
code=0
fi
exit "$code"
- uses: actions/upload-artifact@v3
if: ${{ always() }}
with:
name: my-artifact
path: artifact_*.yml
Raspberry:
if: ${{ true }}
needs: generate-matrix
strategy:
fail-fast: false
matrix: ${{fromJson(needs.generate-matrix.outputs.matrixBSD)}}
runs-on: ubuntu-latest
steps:
- name: Checkout CCI
uses: actions/checkout@v3
with:
repository: ${{ matrix.repo }}
ref: ${{ matrix.ref }}
path: CCI
- name: run
id: test
uses: pguyot/arm-runner-action@main
with:
image_additional_mb: 1024
shell: bash
copy_artifact_path: "artifact_*.yml"
commands: |
export CONAN_SYSREQUIRES_MODE=enabled
export CONAN_SYSREQUIRES_SUDO=0
export DEBIAN_FRONTEND=noninteractive
export PIP_ONLY_BINARY=cmake # workaround scikit-build/cmake-python-distributions#192
apt-get update && apt-get -qq install -y --no-install-recommends python3-pip python3-setuptools pkg-config g++ make
python3 -m pip install --upgrade pip && python3 -m pip install conan distro --ignore-installed
python3 -m pip install cmake -Iv cmake==3.22.0
code=0
set +o pipefail
conan profile detect
conan create CCI/recipes/${{ matrix.package }}/${{ matrix.folder }} --version system -c tools.system.package_manager:mode=install || code=$?
filename=artifact_Raspberry_${{ matrix.job_id }}.yml
echo job_id: ${{ matrix.job_id }} > ${filename}
echo package: ${{ matrix.package }} >> ${filename}
echo pr: ${{ matrix.pr }} >> ${filename}
echo distro: Raspberry >> ${filename}
echo res: $code >> ${filename}
if [ $code == 6 ]
then
code=0
fi
exit "$code"
- uses: actions/upload-artifact@v3
if: ${{ always() }}
with:
name: my-artifact
path: artifact_*.yml
Gather_Results:
name: Gather results
needs: [FreeBSD, Linux, Raspberry]
runs-on: ubuntu-latest
if: ${{ always() }}
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: "3.8"
cache: 'pip' # caching pip dependencies
- run: python3 -m pip install -r requirements.txt
- uses: actions/download-artifact@v3
with:
name: my-artifact
- name: Generate web page
run: |
python create_report.py
- name: Setup Pages
uses: actions/configure-pages@v3
- name: Build with Jekyll
uses: actions/jekyll-build-pages@v1
with:
source: ./pages
destination: ./_site
- name: Upload artifact
uses: actions/upload-pages-artifact@v2
# Deployment job
deploy:
if: ${{ always() }}
# Grant GITHUB_TOKEN the permissions required to make a Pages deployment
permissions:
pages: write # to deploy to Pages
id-token: write # to verify the deployment originates from an appropriate source
# Deploy to the github-pages environment
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
needs: Gather_Results
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v2