Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add github actions #195

Merged
merged 13 commits into from
Dec 28, 2021
Merged

add github actions #195

merged 13 commits into from
Dec 28, 2021

Conversation

N-R-K
Copy link
Member

@N-R-K N-R-K commented Dec 23, 2021

this runs both default and minimal build with gcc and clang.
tcc seems to fail at link time for some reason.


I'm not familiar with github actions/workflow, simply hacked this together from the provided template. Seems to be working fine, here's some example:

this runs both default and minimal build with gcc and clang.
tcc seems to fail at link time for some reason.
@N-R-K N-R-K added the workflow Improvements or additions to workflow label Dec 23, 2021
@N-R-K
Copy link
Member Author

N-R-K commented Dec 23, 2021

@TAAPArthur Any clue on why tcc is failing at linking?

@TAAPArthur
Copy link
Contributor

@TAAPArthur Any clue on why tcc is failing at linking?

I'll take a look. Without looking, I'd guess because it is not to using a recent tcc version. The last "stable" release is really old and behind the git version.

@TAAPArthur
Copy link
Contributor

Yeah it looks like 0.9.27-8 is used. Probably should just build tcc from mob (or some recent hash) if we want to use tcc.

Maybe something like

git clone git://repo.or.cz/tinycc.git
( cd tinycc && ./configure && make)
CC=$PWD/tinycc/tcc OPT_DEP_DEFAULT=1 make

Or of course we could find some binary somewhere.

Can confirm that tcc can build nsixv

@N-R-K
Copy link
Member Author

N-R-K commented Dec 23, 2021

Now it fails compilation and says something about not finding stdarg.h. I'm assuming it's environment related issue: https://github.com/N-R-K/nsxiv/runs/4613227345?check_suite_focus=true

edit: fixed in b39ae9f

@N-R-K
Copy link
Member Author

N-R-K commented Dec 23, 2021

Wonder if someone here is familiar with github actions and can take a look into this for best practices and whatnot.
@kdkasad Giving a ping since I recall you've mentioned github actions somewhere before.

N-R-K added a commit to N-R-K/nsxiv that referenced this pull request Dec 24, 2021
fixes all -Wshadow related warnings (on gcc). this would allow us to use
`-Wshadow` in github workflow (nsxiv#195).

i've thought about adding `-Wshadow` to our Makefile as well, but
decided against it to keep the Makefile CFLAGS barebore/minimal.
This reverts commit a12e10b.

tcc will fail with -Werror due to a false positive:
> commands.c:66: error: function might return no value: 'cg_quit'
Copy link
Contributor

@kdkasad kdkasad left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not very well-versed with GitHub Actions but I would assume that the building/installing TinyCC could be separated into a different step from that of building nsxiv.

It seems like that could even be extracted to a separate job, so that the building of TinyCC only happens once, then the full-build and minimal-build jobs run in parallel after that completes.

So far I've just added some comments on usage of commands, not the structure of the actions themselves.

Edit: It looks like we can even cache dependencies so we don't have to rebuild TinyCC and/or reinstall the debian packages every time: https://docs.github.com/en/actions/advanced-guides/caching-dependencies-to-speed-up-workflows

.github/workflows/build.yml Outdated Show resolved Hide resolved
.github/workflows/build.yml Outdated Show resolved Hide resolved
@N-R-K
Copy link
Member Author

N-R-K commented Dec 25, 2021

@kdkasad Thanks for the review, I've pushed the --quiet change.

As for the cache, I'll look into it in a bit. But without looking, on our minimal-build we're explicitly uninstalling some optional deps to make sure everything compiles/links fine without the optional headers/deps being installed. So that might require some extra fiddling with the cache to get it to work, I presume.

@N-R-K
Copy link
Member Author

N-R-K commented Dec 25, 2021

Thinking again, since our build process is rather fast (25 seconds) I'm fine leaving things be and not bother with caching.

N-R-K added a commit to N-R-K/nsxiv that referenced this pull request Dec 27, 2021
fixes all -Wshadow related warnings (on gcc). this would allow us to use
`-Wshadow` in github workflow (nsxiv#195).

i've thought about adding `-Wshadow` to our Makefile as well, but
decided against it to keep the Makefile CFLAGS barebore/minimal.
@N-R-K
Copy link
Member Author

N-R-K commented Dec 27, 2021

Unless someone wants to bother with caching, I think this PR should be ready to be merged.

@mamg22 mamg22 merged commit ad7ccbf into nsxiv:master Dec 28, 2021
@mamg22
Copy link
Member

mamg22 commented Dec 28, 2021

The first build failed, failing when executing actions/checkout@v2. It seems to be an issue with the action settings in the repo limiting what actions can be run, as indicated in this question.

@N-R-K N-R-K deleted the my_actions branch December 29, 2021 10:53
@N-R-K
Copy link
Member Author

N-R-K commented Dec 29, 2021

I've enabled "allow all actions" in both the repo and the org. The workflow seems to be running now, though it failed at cloning tcc. #194

N-R-K added a commit that referenced this pull request Dec 29, 2021
this runs both default and minimal build with gcc, clang and tcc.
@N-R-K
Copy link
Member Author

N-R-K commented Dec 29, 2021

The workflow fails on my repo as well,

Seems like the Tcc repo isn't reliable. I've switched to a github mirror, cleaned up the commit msg and forced push the changes.

@N-R-K
Copy link
Member Author

N-R-K commented Dec 29, 2021

Now everything is working as expected: https://github.com/nsxiv/nsxiv/runs/4658052056?check_suite_focus=true

The minimal build fails, but that's expected due to #194

@mamg22
Copy link
Member

mamg22 commented Dec 29, 2021

Regarding re-triggering checks, there's a button in the checks tab of a PR that allows running all jobs again, which seems better than closing and reopening.

@N-R-K
Copy link
Member Author

N-R-K commented Dec 29, 2021

there's a button in the checks tab of a PR that allows running all jobs again

That only appears when a workflow has failed afaik. The workflow never ran on that PR to begin with, so had to close and reopen.

N-R-K added a commit to N-R-K/nsxiv that referenced this pull request Dec 29, 2021
fixes all -Wshadow related warnings (on gcc). this would allow us to use
`-Wshadow` in github workflow (nsxiv#195).

i've thought about adding `-Wshadow` to our Makefile as well, but
decided against it to keep the Makefile CFLAGS barebore/minimal.
N-R-K added a commit to N-R-K/nsxiv that referenced this pull request Dec 30, 2021
fixes all -Wshadow related warnings (on gcc). this would allow us to use
`-Wshadow` in github workflow (nsxiv#195).

i've thought about adding `-Wshadow` to our Makefile as well, but
decided against it to keep the Makefile CFLAGS barebore/minimal.
N-R-K added a commit that referenced this pull request Jan 6, 2022
fixes all -Wshadow related warnings (on gcc). this would allow us to use
`-Wshadow` in github workflow (#195).

i've thought about adding `-Wshadow` to our Makefile as well, but
decided against it to keep the Makefile CFLAGS barebore/minimal.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
workflow Improvements or additions to workflow
Projects
None yet
4 participants