/
githubmirror
/
fwupd
Обзор
Документация
Войти
/
githubmirror
/
fwupd
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
.github/workflows/linux.yml
180 строк
7 KB
Richard Hughes
Add an Android CI target for future use
04 авг 2026, 11:34
04 авг 2026, 11:34
fe5ae26
Код
Авторство
О чём код?
on: workflow_call: inputs: publish: required: true type: boolean permissions: contents: read jobs: build: runs-on: ${{ case(matrix.env.ARCH == 'arm64', 'ubuntu-24.04-arm', 'ubuntu-latest') }} needs: library strategy: fail-fast: false matrix: env: # NOTE: values are joined by '-' for name of container image, unless `CONTAINER` overrides it - { DISTRO: arch, ARCH: amd64 } - { DISTRO: centos, ARCH: amd64 } - { DISTRO: debian, ARCH: amd64 } - { DISTRO: debian, ARCH: amd64, VARIANT: i386 } # - { DISTRO: debian, ARCH: amd64, VARIANT: tartan } - { DISTRO: debian, ARCH: arm64 } - { DISTRO: debian, ARCH: arm64, VARIANT: cross-s390x } - { DISTRO: fedora, ARCH: amd64 } - { DISTRO: fedora, ARCH: amd64, VARIANT: openssl, CONTAINER: fedora-amd64 } - { DISTRO: ubuntu, ARCH: amd64 } - { DISTRO: ubuntu, ARCH: amd64, VARIANT: android, CONTAINER: ubuntu-amd64 } env: ${{ matrix.env }} steps: - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 with: persist-credentials: false - name: Login to GitHub Container Registry uses: docker/login-action@dbcb813823bdd20940b903addbd779551569679f # v4.6.0 with: registry: ghcr.io username: ${{ github.actor }} password: ${{ secrets.GITHUB_TOKEN }} - name: Download tarball if: matrix.env.DISTRO == 'fedora' || matrix.env.DISTRO == 'centos' uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: name: tarball - name: Build in container env: CI_NETWORK: true VERSION: ${{ needs.library.outputs.version }} PYTHONWARNINGS: "ignore::DeprecationWarning:gi.events" run: | docker run --privileged -t \ -e "CI=$CI" \ -e "CI_NETWORK=$CI_NETWORK" \ -e "VARIANT=$VARIANT" \ -e "VERSION=$VERSION" \ -e "PYTHONWARNINGS=$PYTHONWARNINGS" \ -v "$GITHUB_WORKSPACE:/github/workspace" \ "ghcr.io/fwupd/fwupd/fwupd-${{ matrix.env.CONTAINER || join(matrix.env.*, '-') }}:latest" \ "./contrib/ci/$DISTRO${VARIANT:+-$VARIANT}.sh" - name: Save any applicable artifacts if: ${{ !cancelled() }} uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 with: name: ${{ join(matrix.env.*, '-') }} path: | ${{ github.workspace }}/build/meson-logs/scanbuild/* ${{ github.workspace }}/dist/* if-no-files-found: ignore - name: Check if tests supported id: supported run: | if [ -x "./contrib/ci/$DISTRO${VARIANT:+-$VARIANT}-test.sh" ]; then echo "supported=true" >>"$GITHUB_OUTPUT" else echo "supported=false" >>"$GITHUB_OUTPUT" fi - name: Test in container if: steps.supported.outputs.supported == 'true' env: CI_NETWORK: true PYTHONWARNINGS: "ignore::DeprecationWarning:gi.events" run: | docker run --privileged -t \ -e "CI=$CI" \ -e "CI_NETWORK=$CI_NETWORK" \ -e "VARIANT=$VARIANT" \ -e "VERSION=$VERSION" \ -e "PYTHONWARNINGS=$PYTHONWARNINGS" \ -v "$GITHUB_WORKSPACE:/github/workspace" \ "ghcr.io/fwupd/fwupd/fwupd-${{ matrix.env.CONTAINER || join(matrix.env.*, '-') }}:latest" \ "./contrib/ci/$DISTRO${VARIANT:+-$VARIANT}-test.sh" - name: Save any coverage data uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 with: name: coverage-${{ join(matrix.env.*, '-') }} path: ${{ github.workspace }}/coverage.xml - name: Upload to codecov if: steps.supported.outputs.supported == 'true' && matrix.env.VARIANT != 'tartan' && ( matrix.env.DISTRO == 'arch' || matrix.env.DISTRO == 'debian' || matrix.env.DISTRO == 'fedora') uses: codecov/codecov-action@fb8b3582c8e4def4969c97caa2f19720cb33a72f # v7.0.0 env: CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} library: runs-on: ubuntu-latest env: PYTHONWARNINGS: "ignore::DeprecationWarning:gi.events" outputs: version: ${{ steps.version.outputs.version }} steps: - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 with: persist-credentials: false - name: Refresh dependencies run: | sudo rm -f /etc/apt/sources.list.d/microsoft-prod.list sudo add-apt-repository -y ppa:peter-hutterer/meson1.11 sudo apt update -qq - name: Install dependencies run: | sudo apt install -qq --yes meson sudo ./contrib/ci/fwupd_setup_helpers.py install-dependencies -o ubuntu --yes - name: Build run: | meson setup build \ -Dbuild=library \ -Ddocs=disabled \ -Dman=false \ -Dauto_features=disabled \ -Dtests=false ninja -C build dist - name: Save version id: version run: | echo "version=$(meson introspect build --projectinfo | jq -r .version)" >>"$GITHUB_OUTPUT" - name: Save tarball uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 with: name: tarball path: ${{ github.workspace }}/build/meson-dist/*xz publish-docs: if: ${{ inputs.publish }} runs-on: ubuntu-latest needs: build steps: - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 with: persist-credentials: false - name: Download artifact uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: name: ubuntu-amd64 - name: Install SSH key uses: shimataro/ssh-key-action@87a8f067114a8ce263df83e9ed5c849953548bc3 # v2.8.1 with: key: ${{ secrets.FWUPD_GITHUB_IO_SSH_KEY }} name: id_rsa # optional known_hosts: unnecessary if_key_exists: fail # replace / ignore / fail; optional (defaults to fail) - name: Clone docs run: | cd share/doc/fwupd git clone --depth 1 git@github.com:fwupd/fwupd.github.io.git - name: Trigger docs deployment run: | cd share/doc/fwupd/fwupd.github.io git config credential.helper 'cache --timeout=120' git config user.email "info@fwupd.org" git config user.name "Documentation deployment Bot" rm -rf ./* cp ../../libfwupd* ../*html . -R git add . git commit -a --allow-empty -m "Trigger deployment" git push git@github.com:fwupd/fwupd.github.io.git