CI #11587
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 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@v4 | |
- name: Checkout CCI | |
uses: actions/checkout@v4 | |
with: | |
repository: conan-io/conan-center-index | |
path: CCI | |
- uses: actions/setup-python@v5 | |
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: ubuntu-22.04 | |
env: | |
CC: clang | |
CXX: clang++ | |
CONAN_SYSREQUIRES_MODE: enabled | |
steps: | |
- name: Checkout CCI | |
uses: actions/checkout@v4 | |
with: | |
repository: ${{ matrix.repo }} | |
ref: ${{ matrix.ref }} | |
path: CCI | |
- name: run | |
id: test | |
uses: vmactions/freebsd-vm@v1 | |
with: | |
envs: 'CONAN_MAKE_PROGRAM CC CXX CONAN_SYSREQUIRES_MODE' | |
usesh: true | |
prepare: pkg install -y cmake py311-pip py311-sqlite3 sudo pkgconf | |
run: | | |
python3.11 -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_${{ github.job }}_${{ strategy.job-index }}.yml | |
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@v4 | |
if: ${{ always() }} | |
with: | |
name: my-artifact-${{ github.job }}-${{ strategy.job-index }} | |
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/tumbleweed) | |
zypper --non-interactive install python3 python3-pipx python3-setuptools python3-wheel tar gzip pkg-config gcc-c++ make | |
;; | |
opensuse/leap) | |
zypper --non-interactive install python3 python3-pip python3-setuptools python3-wheel tar gzip pkg-config gcc-c++ make | |
python3 -m pip install --user pipx | |
;; | |
debian*) | |
apt-get update && apt-get -qq install -y --no-install-recommends pipx python3-setuptools python3-venv pkg-config g++ make | |
;; | |
ubuntu*) | |
apt-get update && apt-get -qq install -y --no-install-recommends pipx python3-setuptools python3-venv pkg-config g++ 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 | |
python3 -m pip install --user pipx | |
;; | |
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 | |
python3 -m pip install --user pipx | |
;; | |
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 pipx pkgconf-pkg-config gcc-c++ make;; | |
archlinux*) | |
pacman -Syu --noconfirm python-pipx python-platformdirs gcc pkgconf gcc make;; | |
fedora*) | |
dnf -y install python3 python3-wheel pipx pkgconf g++ make;; | |
alpine*) | |
apk add bash python3 py3-wheel pipx pkgconf g++ make;; | |
esac | |
- name: Checkout CCI | |
uses: actions/checkout@v4 | |
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: | | |
export PATH=~/.local/bin:$PATH | |
pipx install conan | |
pipx install distro | |
pipx install cmake | |
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=$? | |
filename=artifact_${{ github.job }}_${{ strategy.job-index }}.yml | |
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@v4 | |
if: ${{ always() }} | |
with: | |
name: my-artifact-${{ github.job }}-${{ strategy.job-index }} | |
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@v4 | |
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 pipx python3-setuptools python3-venv pkg-config g++ make | |
export PATH=/opt/pipx_bin:$PATH | |
pipx install conan | |
pipx install distro | |
pipx install cmake --pip-args "-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_${{ github.job }}_${{ strategy.job-index }}.yml | |
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@v4 | |
if: ${{ always() }} | |
with: | |
name: my-artifact-${{ github.job }}-${{ strategy.job-index }} | |
path: artifact_*.yml | |
Gather_Results: | |
name: Gather results | |
needs: [FreeBSD, Linux, Raspberry] | |
runs-on: ubuntu-latest | |
if: ${{ always() }} | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-python@v5 | |
with: | |
python-version: "3.8" | |
cache: 'pip' # caching pip dependencies | |
- run: python3 -m pip install -r requirements.txt | |
- uses: actions/download-artifact@v4 | |
with: | |
pattern: my-artifact-* | |
merge-multiple: true | |
- name: Generate web page | |
run: | | |
pwd | |
ls -al | |
python create_report.py | |
ls -al | |
ls -al pages | |
- name: Setup Pages | |
uses: actions/configure-pages@v5 | |
- name: Build with Jekyll | |
uses: actions/jekyll-build-pages@v1 | |
with: | |
source: ./pages | |
destination: ./_site | |
- name: Upload artifact | |
uses: actions/upload-pages-artifact@v3 | |
# 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 | |
actions: read | |
# 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@v4 |