Skip to content

Commit

Permalink
CI: switch from Travis CI to GitHub Actions
Browse files Browse the repository at this point in the history
Travis CI use credits now. We need to pay or to beg to have more credits...
  • Loading branch information
TheTumultuousUnicornOfDarkness committed Jan 17, 2021
1 parent a1f0441 commit 0379f31
Show file tree
Hide file tree
Showing 4 changed files with 79 additions and 39 deletions.
40 changes: 40 additions & 0 deletions .github/workflows/linux.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Linux build

on:
push:
branches:
- '*'
pull_request:
branches:
- '*'

jobs:
linux-build:
name: Linux x64_64 (Build)
runs-on: ${{ matrix.os.label }}
strategy:
matrix:
os:
- { label: ubuntu-16.04 }
- { label: ubuntu-18.04 }
- { label: ubuntu-20.04 }

steps:
- uses: actions/checkout@v2

- name: Build CPU-X
run: bash ./scripts/build_ubuntu.sh "Debug" "$GITHUB_WORKSPACE"

- name: Run tests
run: ninja -C build test

- name: Run CPU-X
run: |
sudo CPUX_BCLK=100 cpu-x --issue-fmt
cat /tmp/cpu-x.log
cat /tmp/cpu-x-daemon.log
- name: Test CPU database with LibCPUID tests
run: |
git clone https://github.com/anrieff/libcpuid.git "/tmp/libcpuid"
bash ./scripts/run_libcpuid_tests.sh "/tmp/libcpuid/tests"
33 changes: 0 additions & 33 deletions .travis.yml

This file was deleted.

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

| Linux | FreeBSD | AppImage |
| :---: | :---: | :---: |
| [![Build Status (Linux)](https://travis-ci.com/X0rg/CPU-X.svg?branch=master)](https://travis-ci.com/github/X0rg/CPU-X) | [![Build Status (FreeBSD)](https://api.cirrus-ci.com/github/X0rg/CPU-X.svg)](https://cirrus-ci.com/github/X0rg/CPU-X) | [![AppImage Continuous](https://github.com/X0rg/CPU-X/workflows/AppImage%20Continuous/badge.svg?branch=master)](https://github.com/X0rg/CPU-X/actions?query=workflow%3A%22AppImage+Continuous%22) |
| [![Build Status (Linux)](https://github.com/X0rg/CPU-X/workflows/Linux%20build/badge.svg?branch=master)](https://github.com/X0rg/CPU-X/actions?query=workflow%3A%22Linux+build%22) | [![Build Status (FreeBSD)](https://api.cirrus-ci.com/github/X0rg/CPU-X.svg)](https://cirrus-ci.com/github/X0rg/CPU-X) | [![AppImage Continuous](https://github.com/X0rg/CPU-X/workflows/AppImage%20Continuous/badge.svg?branch=master)](https://github.com/X0rg/CPU-X/actions?query=workflow%3A%22AppImage+Continuous%22) |

**CPU-X** is a Free software that gathers information on CPU, motherboard and more.
CPU-X is a system profiling and monitoring application (similar to [CPU-Z for Windows](https://www.cpuid.com/softwares/cpu-z.html)), but CPU-X is a Free and Open Source software designed for GNU/Linux and FreeBSD.
Expand Down
43 changes: 38 additions & 5 deletions scripts/build_ubuntu.sh
Original file line number Diff line number Diff line change
@@ -1,31 +1,64 @@
#!/bin/bash

source /etc/os-release

if [[ $# -lt 2 ]]; then
echo "$0: BUILD_TYPE SOURCE_DIRECTORY [INSTALL_DIRECTORY]"
exit 1
fi

if [[ "$ID" != "ubuntu" ]]; then
echo "$0: this script must be run on a Ubuntu system"
exit 1
fi

BUILD_TYPE="$1"
SRC_DIR="$2"
DST_DIR="$3"
[[ -z "$DST_DIR" ]] && APPIMAGE=0 || APPIMAGE=1

case "$VERSION_ID" in
"16.04") PACKAGES=('libncursesw5-dev' 'libncursesw5' 'libcpuid15-git' 'libpci3' 'libprocps4');;
"18.04") PACKAGES=('libncursesw5-dev' 'libncursesw5' 'libcpuid15-git' 'libpci3' 'libprocps6');;
"20.04") PACKAGES=('libncurses-dev' 'libncursesw6' 'libcpuid15-git' 'libpci3' 'libprocps8');;
*) echo "Unsupported Ubuntu version: $VERSION_ID" ; exit 1;;
esac

echo "Add OBS repository"
echo 'deb http://download.opensuse.org/repositories/home:/Xorg/xUbuntu_16.04/ /' | sudo tee /etc/apt/sources.list.d/home:Xorg.list
curl -sSL https://download.opensuse.org/repositories/home:Xorg/xUbuntu_16.04/Release.key | sudo apt-key add -
echo "deb http://download.opensuse.org/repositories/home:/Xorg/xUbuntu_${VERSION_ID}/ /" | sudo tee /etc/apt/sources.list.d/home:Xorg.list
curl -sSL "https://download.opensuse.org/repositories/home:Xorg/xUbuntu_${VERSION_ID}/Release.key" | sudo apt-key add -
sudo apt-get update -qq

echo "Install packages"
sudo apt-get install -y -qq cmake ninja-build nasm gettext libgtk-3-dev libncursesw5-dev libcpuid-dev-git libpci-dev libprocps-dev libgtk-3-0 libncursesw5 libcpuid15-git libpci3 libprocps4 adwaita-icon-theme
sudo apt-get install -y -qq \
cmake \
ninja-build \
nasm \
gettext \
adwaita-icon-theme \
"${PACKAGES[@]}" \
libgtk-3-0 \
libgtk-3-dev \
libcpuid-dev-git \
libpci-dev \
libprocps-dev

echo "Run CMake"
cmake -S "$SRC_DIR" -B build -GNinja -DCMAKE_BUILD_TYPE="$BUILD_TYPE" -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_INSTALL_LIBEXECDIR=/usr/bin -DAPPIMAGE=1
cmake -S "$SRC_DIR" \
-B build \
-GNinja \
-DCMAKE_BUILD_TYPE="$BUILD_TYPE" \
-DCMAKE_INSTALL_PREFIX=/usr \
-DCMAKE_INSTALL_LIBEXECDIR=/usr/bin \
-DAPPIMAGE=$APPIMAGE

echo "Build CPU-X"
cmake --build build

echo "Install CPU-X"
if [[ -z "$DST_DIR" ]]; then
echo "Install CPU-X on system"
sudo ninja -C build install
else
echo "Install CPU-X in AppDir"
DESTDIR="$DST_DIR" ninja -C build install
fi

0 comments on commit 0379f31

Please sign in to comment.