Author Topic: github action [Resolved]  (Read 176790 times)

Offline jarod42

  • Multiple posting newcomer
  • *
  • Posts: 87
github action [Resolved]
« on: September 28, 2020, 06:50:53 pm »
Do you know how to set up a github action to use CB?

I got

> Error: Unable to initialize GTK+, is DISPLAY set properly?

when using

Code
codeblocks --no-splash-screen --target=Release --build Project.workspace
« Last Edit: January 01, 2021, 03:07:31 pm by jarod42 »

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13406
    • Travis build status
Re: github action
« Reply #1 on: September 28, 2020, 08:56:27 pm »
You can't. Using the build system of cb on headless linux is not possible at the moment.
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline BlueHazzard

  • Developer
  • Lives here!
  • *****
  • Posts: 3352
Re: github action
« Reply #2 on: September 29, 2020, 04:22:33 pm »
Can you install some dummy x server? I have Xvfb on my headless server and it works (somehow, there are still some quirks)

Offline jarod42

  • Multiple posting newcomer
  • *
  • Posts: 87
Re: github action
« Reply #3 on: December 08, 2020, 05:33:09 pm »
Just found GabrielBB/xvfb-action
which allows to run CB:

Notice that default.conf has also to be provided.

result is similar to:

Code
name: ubuntu-codeblocks

on: [push, pull_request]

jobs:
  linux:
    runs-on: ubuntu-latest

    steps:
    - name: Checkout
      uses: actions/checkout@v2

    - name: apt-get update
      run: sudo apt-get update -y

    - name: apt-get install -y codeblocks
      run: sudo apt-get install -y codeblocks

    - name: codeblocks's default configuration
      run: |
        mkdir -p ~/.config/codeblocks
        cp codeblocks/default.conf ~/.config/codeblocks/

    - name: build projects
      uses: GabrielBB/xvfb-action@v1 # fake X-server as codeblocks requires displays :/
      with:
        run: codeblocks --no-splash-screen --target=Release --build Project.workspace
 


my action
« Last Edit: December 28, 2020, 10:17:11 pm by jarod42 »

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 6239
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: github action [Resolved]
« Reply #4 on: Today at 09:50:25 am »
Hi, jarod42, I'm currently having a similar github action issue in the Windows platform, see this post:

how to let github action to run codeblocks.exe to build cbp project

Can you have a look.

It looks like your project is still actively maintained, but your project is for linux system?

Thanks.
If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.