Skip to content

Commit

Permalink
Fix CI (#24)
Browse files Browse the repository at this point in the history
* Fix CI

ubuntu-latest now has newer libcec

Signed-off-by: Sami Salonen <ssalonen@gmail.com>

* Bump libcec versions

Signed-off-by: Sami Salonen <ssalonen@gmail.com>

* fixing..

Signed-off-by: Sami Salonen <ssalonen@gmail.com>

* Utilizing apt patterns for more robust installation of dependencies

Signed-off-by: Sami Salonen <ssalonen@gmail.com>

* syntax fix

Signed-off-by: Sami Salonen <ssalonen@gmail.com>

* debugging

Signed-off-by: Sami Salonen <ssalonen@gmail.com>

* Utilizing ubuntu 22.04

Signed-off-by: Sami Salonen <ssalonen@gmail.com>

* backports

Signed-off-by: Sami Salonen <ssalonen@gmail.com>

* Fixes

Signed-off-by: Sami Salonen <ssalonen@gmail.com>

* stricter checking

Signed-off-by: Sami Salonen <ssalonen@gmail.com>

* debug

Signed-off-by: Sami Salonen <ssalonen@gmail.com>

* fixes

Signed-off-by: Sami Salonen <ssalonen@gmail.com>

* simplify

Signed-off-by: Sami Salonen <ssalonen@gmail.com>
  • Loading branch information
ssalonen committed Aug 6, 2022
1 parent 079db7f commit 77383a1
Showing 1 changed file with 45 additions and 50 deletions.
95 changes: 45 additions & 50 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,65 +15,66 @@ jobs:
matrix:
rust: [stable]
job:
- os: ubuntu-latest
- os: ubuntu-22.04
target: aarch64-unknown-linux-gnu
libcec: vendored-libcec
use-cross: true
libcec: vendored-libcec
expected_libcec_abi: 4
- os: ubuntu-latest
- os: ubuntu-22.04
target: i686-unknown-linux-gnu
libcec: vendored-libcec
use-cross: true
libcec: vendored-libcec
expected_libcec_abi: 4
- os: ubuntu-latest
- os: ubuntu-22.04
target: arm-unknown-linux-gnueabi
libcec: vendored-libcec
use-cross: true
libcec: vendored-libcec
expected_libcec_abi: 4
- os: ubuntu-latest
- os: ubuntu-22.04
target: armv7-unknown-linux-gnueabihf
libcec: vendored-libcec
use-cross: true
libcec: vendored-libcec
expected_libcec_abi: 4
- os: ubuntu-latest
- os: ubuntu-22.04
target: mips-unknown-linux-gnu
use-cross: true
libcec: vendored-libcec
expected_libcec_abi: 4
- os: ubuntu-latest
- os: ubuntu-22.04
target: mips64-unknown-linux-gnuabi64
libcec: vendored-libcec
use-cross: true
libcec: vendored-libcec
expected_libcec_abi: 4
- os: ubuntu-latest
- os: ubuntu-22.04
target: mips64el-unknown-linux-gnuabi64
libcec: vendored-libcec
use-cross: true
libcec: vendored-libcec
expected_libcec_abi: 4
- os: ubuntu-latest
- os: ubuntu-22.04
target: mipsel-unknown-linux-gnu
libcec: vendored-libcec
use-cross: true
libcec: vendored-libcec
expected_libcec_abi: 4
- os: ubuntu-latest
- os: ubuntu-22.04
target: x86_64-unknown-linux-gnu
libcec: vendored-libcec
use-cross: true
libcec: vendored-libcec
expected_libcec_abi: 4
#
# libcec discovery with pkg config
#
- os: ubuntu-latest
- os: ubuntu-22.04
target: x86_64-unknown-linux-gnu
use-cross: false # Important that we do not run cross so package install shows up
libcec: libcec4
libcec-dev: libcec-dev
libcec: "libcec4"
libcec-dev: "libcec-dev=4*"
pkg-config: true
expected_libcec_abi: 4
- os: ubuntu-latest
- os: ubuntu-22.04
target: x86_64-unknown-linux-gnu
use-cross: false # Important that we do not run cross so package install shows up
libcec: libcec6_6.0.2-1ubuntu1_amd64.deb
libcec-dev: libcec-dev_6.0.2-1ubuntu1_amd64.deb
libcec: "libcec6"
libcec-dev: "libcec-dev=6*"
pkg-config: true
expected_libcec_abi: 6
steps:
Expand All @@ -86,36 +87,30 @@ jobs:
profile: minimal
target: ${{ matrix.job.target }}
override: true
# libcec from apt repo:
- if: ${{ !startsWith(matrix.job.libcec, 'vendored') && endsWith(matrix.job.libcec, '.deb') }}
name: Install libcec (manually downloaded .deb)
run: |
sudo apt-get install -yq libudev-dev libp8-platform2 libp8-platform-dev
TEMP_DOWNLOAD="$(mktemp)" &&
wget -O "$TEMP_DOWNLOAD" 'http://se.archive.ubuntu.com/ubuntu/pool/universe/libc/libcec/${{ matrix.job.libcec }}' &&
sudo dpkg -i "$TEMP_DOWNLOAD"
rm -f "$TEMP_DOWNLOAD"
# libcec-dev from apt repo:
- if: ${{ endsWith(matrix.job.libcec-dev, '.deb') }}
name: Install libcec-dev (manually downloaded .deb)
# libcec and p8-platform from apt repo
- if: ${{ !startsWith(matrix.job.libcec, 'vendored') }}
name: Install libcec(-dev) and build dependencies
run: |
set -e
# introduce Ubuntu 20.04 (Focal Fossa) repos as well for easy libcec4 installation
sudo sh -c 'echo "deb http://archive.ubuntu.com/ubuntu/ focal main restricted universe multiverse" >> /etc/apt/sources.list'
sudo apt-get update
sudo apt-get install -yq libudev-dev libp8-platform2 libp8-platform-dev
TEMP_DOWNLOAD="$(mktemp)" &&
wget -O "$TEMP_DOWNLOAD" 'http://se.archive.ubuntu.com/ubuntu/pool/universe/libc/libcec/${{ matrix.job.libcec-dev }}' &&
sudo dpkg -i "$TEMP_DOWNLOAD"
rm -f "$TEMP_DOWNLOAD"
# libcec from apt repo:
- if: ${{ !startsWith(matrix.job.libcec, 'vendored') && !endsWith(matrix.job.libcec, '.deb') }}
name: Install libcec(-dev) and build dependencies
run: sudo apt-get install -yq libudev-dev libp8-platform2 libp8-platform-dev ${{ matrix.job.libcec }} ${{ matrix.job.libcec-dev }}
apt show '${{ matrix.job.libcec }}'
sudo apt install -yq '${{ matrix.job.libcec }}'
apt show '${{ matrix.job.libcec-dev }}'
sudo apt install -yq '${{ matrix.job.libcec-dev }}'
# additional build dependencies for non-cross builds with vendored libcec sources
- if: ${{ startsWith(matrix.job.libcec, 'vendored') && !matrix.job.use-cross }}
name: Install libudev-dev for non-cross vendored builds as libcec build dependency
run: sudo apt-get install -yq libudev-dev
# pkg-config install/remove
# pkg-config install
- if: ${{ !startsWith(matrix.job.libcec, 'vendored') && matrix.job.pkg-config }}
name: Install pkg-config for utilizing libcec from apt build dependency
run: sudo apt-get install -yq pkg-config
# pkg-config remove
- if: ${{ !startsWith(matrix.job.libcec, 'vendored') && !matrix.job.pkg-config }}
name: Remove pkg-config
run: sudo apt-get remove -yq pkg-config
Expand All @@ -128,11 +123,11 @@ jobs:
command: test
use-cross: ${{ matrix.job.use-cross }}
toolchain: ${{ matrix.rust }}
args: --target ${{ matrix.job.target }}
args: --target ${{ matrix.job.target }} -vv

rustfmt:
name: Rustfmt
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
steps:
- name: Checkout repository
uses: actions/checkout@v2
Expand All @@ -151,7 +146,7 @@ jobs:

clippy:
name: Clippy
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
steps:
- name: Checkout repository
uses: actions/checkout@v2
Expand All @@ -172,14 +167,14 @@ jobs:

coverage:
name: Code coverage
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Update apt
run: sudo apt-get update
- name: Install dependencies for build and coverage
run: sudo apt-get install libudev-dev libcec4 libcec-dev pkg-config libp8-platform-dev
run: sudo apt-get install libudev-dev libcec6 libcec-dev pkg-config libp8-platform-dev
- name: Install stable toolchain
uses: actions-rs/toolchain@v1
with:
Expand All @@ -191,7 +186,7 @@ jobs:
with:
args: "--ignore-tests --out Lcov"
env:
EXPECTED_LIBCEC_VERSION_MAJOR: 4
EXPECTED_LIBCEC_VERSION_MAJOR: 6
- name: Upload to Coveralls
# upload only if push
if: ${{ github.event_name == 'push' }}
Expand Down

0 comments on commit 77383a1

Please sign in to comment.