Skip to content

Commit

Permalink
Merge pull request #663 from nuttyartist/feat/zjeffer/dockerfiles
Browse files Browse the repository at this point in the history
Use docker images for CI/CD (fedora & opensuse)
  • Loading branch information
zjeffer authored Dec 22, 2023
2 parents ddb85cb + 84b3a4c commit 438b7f5
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 19 deletions.
29 changes: 10 additions & 19 deletions .github/workflows/linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -103,34 +103,25 @@ jobs:
path: ${{ steps.deb.outputs.path }}

rpm:
name: rpm (${{ matrix.build-type }}, Qt ${{ matrix.qt-version-major }}, ${{ matrix.container != '' && matrix.container || matrix.os }})
runs-on: ${{ matrix.os }}
container: ${{ matrix.container }}
name: rpm (${{ matrix.build-type }}, Qt ${{ matrix.qt-version-major }}, ${{ matrix.image }})
runs-on: ubuntu-latest
container: zjeffer/notes:${{ matrix.image }}
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-20.04
# Fedora's release cycle: https://docs.fedoraproject.org/en-US/releases/lifecycle/
container: fedora:38
- # Fedora's release cycle: https://docs.fedoraproject.org/en-US/releases/lifecycle/
image: fedora
qt-version-major: 6
build-type: release

- os: ubuntu-20.04
container: opensuse/leap:15
- image: opensuse
qt-version-major: 6
build-type: release
steps:
- name: Install build dependencies
env:
PKG_MANAGER: ${{ startsWith(matrix.container, 'fedora') && 'dnf' || 'zypper' }}
# Fedora doesn't include libxkbcommon-devel as a dependency of Qt 6, so have to install it manually.
PKG_LIST: ${{ startsWith(matrix.container, 'fedora') && 'libxkbcommon-devel qt6-qtbase-private-devel qt6-qtdeclarative-devel' || 'qt6-base-private-devel qt6-declarative-devel' }}
run: |
${{ env.PKG_MANAGER }} update -y
${{ env.PKG_MANAGER }} install -y cmake gcc git ${{ env.PKG_LIST }} rpm-build rpmlint
# Prevent git's dubious ownership message
git config --global --add safe.directory "${PWD}"
- name: Setup git configuration
# workaround for "detected dubious ownership in repository" git error: https://github.com/actions/checkout/issues/1169
run: git config --global --add safe.directory "${PWD}"

- name: Checkout code
uses: actions/checkout@v3
Expand Down Expand Up @@ -164,7 +155,7 @@ jobs:
VERBOSE: 1
# openSUSE defaults to GCC 7, which doesn't support the filesystem library from C++17,
# and causes trouble compiling for Qt 6. So we have to manully specify GCC 10 instead.
CXX: ${{ startsWith(matrix.container, 'opensuse') && 'g++-10' || 'g++' }}
CXX: ${{ startsWith(matrix.image, 'opensuse') && 'g++-10' || 'g++' }}
run: |
cmake --warn-uninitialized --warn-unused-vars \
-B build \
Expand Down
5 changes: 5 additions & 0 deletions Dockerfiles/fedora
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
FROM fedora:38

RUN dnf update -y && \
dnf install -y cmake gcc git rpm-build rpmlint \
libxkbcommon-devel qt6-qtbase-private-devel qt6-qtdeclarative-devel
5 changes: 5 additions & 0 deletions Dockerfiles/opensuse
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
FROM opensuse/leap:15

RUN zypper update -y && \
zypper install -y cmake gcc git rpm-build rpmlint \
qt6-base-private-devel qt6-declarative-devel

0 comments on commit 438b7f5

Please sign in to comment.