Skip to content

Commit

Permalink
ci: add Pelles-C compilation on GitHub Actions
Browse files Browse the repository at this point in the history
  • Loading branch information
nemequ committed Sep 12, 2024
1 parent ea94459 commit a79168e
Show file tree
Hide file tree
Showing 4 changed files with 113 additions and 11 deletions.
2 changes: 1 addition & 1 deletion .appveyor.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
version: "{build}"
branches:
except:
- /^(wip\/)?(travis|osx)(\-.+)?$/
- /^(wip\/)?(travis|osx|gha)(\-.+)?$/

environment:
matrix:
Expand Down
62 changes: 62 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
on:
push:
branches-ignore:
- 'ci/**'
- '!ci/gha**'
- 'dependabot/**'
pull_request:
branches:
- 'master'

jobs:
pelles-c:
runs-on: windows-latest
strategy:
matrix:
version:
# https://community.chocolatey.org/packages/pelles-c#versionhistory
- "12.0.2"
# - "11.0.2"
# - "10.0.6"
# - "9.00.0.0"
# - "8.00.0.0"
steps:
- uses: actions/checkout@v2
- name: Install Pelles-C
uses: crazy-max/ghaction-chocolatey@v3
with:
args: install pelles-c --version "${{ matrix.version }}" --no-progress
- name: Install Windows SDK
uses: crazy-max/ghaction-chocolatey@v3
with:
args: install windows-sdk-10.0 --no-progress
- name: Print Env
run: 'Get-ChildItem Env:'
# - name: Find kernel32.lib
# # run: dir /s kernel32.lib
# run: Get-ChildItem -Path C:\ -Filter kernel32.lib -Recurse -ErrorAction SilentlyContinue -Force
# working-directory: 'C:\'
- name: Compile
env:
CC: 'C:\Program Files\PellesC\bin\pocc.exe'
LD: 'C:\Program Files\PellesC\bin\polink.exe'
CFLAGS: '/IC:\Progra~1\PellesC\Include'
LDFLAGS: '/LIBPATH:C:\Progra~1\PellesC\lib /LIBPATH:C:\Progra~1\PellesC\Lib\Win'
working-directory: test
run: make -f Makefile.pelles

nvhpc:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Install NVidia HPC SDK
run: |
curl https://developer.download.nvidia.com/hpc-sdk/ubuntu/DEB-GPG-KEY-NVIDIA-HPC-SDK | sudo gpg --dearmor -o /usr/share/keyrings/nvidia-hpcsdk-archive-keyring.gpg
echo 'deb [signed-by=/usr/share/keyrings/nvidia-hpcsdk-archive-keyring.gpg] https://developer.download.nvidia.com/hpc-sdk/ubuntu/amd64 /' | sudo tee /etc/apt/sources.list.d/nvhpc.list
sudo apt-get update -y
sudo apt-get install -y nvhpc
- name: Compile
env:
CC: /opt/nvidia/hpc_sdk/Linux_x86_64/*.*/compilers/bin/nvcc
working-directory: test
run: make
12 changes: 6 additions & 6 deletions test/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ else ifeq ($(notdir $(CC)), suncc)
else ifeq ($(notdir $(CC)),$(filter $(notdir $(CC)),armcl cl2000 cl430 cl6x cl7x clpru))
CFLAGS ?= --display_error_number --emit_warnings_as_errors --issue_remarks -i $(dir $(shell readlink -f $(shell which $(CC))))../include
C_OUTPUT_FILE := --output_file=
else ifeq ($(notdir $(CC)), pgcc)
else ifeq ($(notdir $(CC)),$(filter $(notdir $(CC)),pgcc nvcc))
CFLAGS ?= -Minform=inform -c11
C_OUTPUT_FILE := -o
else ifeq ($(notdir $(CC)), pgc++)
else ifeq ($(notdir $(CC)),$(filter $(notdir $(CC)),pgc++ nvc++))
CFLAGS ?= --display_error_number -Minform=inform -Werror
C_OUTPUT_FILE := -o
else ifeq ($(notdir $(CC)), xlc)
Expand Down Expand Up @@ -249,12 +249,12 @@ Makefile.icl: Makefile

Makefile.pelles: Makefile
@echo -e "# Generated by Makefile. Do not edit.\r" > $@
@echo -e "CC = pocc\r" >> $@
@echo -e "LD = polink\r" >> $@
@echo -e "CC ?= pocc\r" >> $@
@echo -e "LD ?= polink\r" >> $@
@echo -e "\r" >> $@

@echo -e "CFLAGS = \r" >> $@
@echo -e "LDFLAGS = \r" >> $@
@echo -e "CFLAGS ?= \r" >> $@
@echo -e "LDFLAGS ?= \r" >> $@
@echo -e "\r" >> $@

@echo -e "TESTS = \x5c\r" >> $@
Expand Down
48 changes: 44 additions & 4 deletions test/Makefile.pelles
Original file line number Diff line number Diff line change
@@ -1,24 +1,27 @@
# Generated by Makefile. Do not edit.
CC = pocc
LD = polink
CC ?= pocc
LD ?= polink

CFLAGS =
LDFLAGS =
CFLAGS ?=
LDFLAGS ?=

TESTS = \
array-param.exe \
assume.exe \
cast.exe \
concat.exe \
const.exe \
constant.exe \
deprecated.exe \
empty-bases.exe \
fallthrough.exe \
flags.exe \
inline.exe \
likely.exe \
malloc.exe \
message.exe \
noinline.exe \
no-escape.exe \
no-return.exe \
non-null.exe \
predict.exe \
Expand All @@ -30,9 +33,11 @@ TESTS = \
sentinel.exe \
static-assert.exe \
stringify.exe \
unknown-cpp-attributes.exe \
unknown-pragmas.exe \
unavailable.exe \
unreachable.exe \
unused-function.exe \
visibility.exe \
warn.exe \
warn-unused-result.exe \
Expand All @@ -42,16 +47,19 @@ CLEANFILES = $(TESTS) \
array-param.obj array-param.exe \
assume.obj assume.exe \
cast.obj cast.exe \
concat.obj concat.exe \
const.obj const.exe \
constant.obj constant.exe \
deprecated.obj deprecated.exe \
empty-bases.obj empty-bases.exe \
fallthrough.obj fallthrough.exe \
flags.obj flags.exe \
inline.obj inline.exe \
likely.obj likely.exe \
malloc.obj malloc.exe \
message.obj message.exe \
noinline.obj noinline.exe \
no-escape.obj no-escape.exe \
no-return.obj no-return.exe \
non-null.obj non-null.exe \
predict.obj predict.exe \
Expand All @@ -63,9 +71,11 @@ CLEANFILES = $(TESTS) \
sentinel.obj sentinel.exe \
static-assert.obj static-assert.exe \
stringify.obj stringify.exe \
unknown-cpp-attributes.obj unknown-cpp-attributes.exe \
unknown-pragmas.obj unknown-pragmas.exe \
unavailable.obj unavailable.exe \
unreachable.obj unreachable.exe \
unused-function.obj unused-function.exe \
visibility.obj visibility.exe \
warn.obj warn.exe \
warn-unused-result.obj warn-unused-result.exe \
Expand Down Expand Up @@ -94,6 +104,12 @@ cast.obj: cast.c
cast.exe: cast.obj
$(LD) $(LDFLAGS) /OUT:cast.exe cast.obj

concat.obj: concat.c
$(CC) $(CFLAGS) concat.c

concat.exe: concat.obj
$(LD) $(LDFLAGS) /OUT:concat.exe concat.obj

const.obj: const.c
$(CC) $(CFLAGS) const.c

Expand All @@ -112,6 +128,12 @@ deprecated.obj: deprecated.c
deprecated.exe: deprecated.obj
$(LD) $(LDFLAGS) /OUT:deprecated.exe deprecated.obj

empty-bases.obj: empty-bases.c
$(CC) $(CFLAGS) empty-bases.c

empty-bases.exe: empty-bases.obj
$(LD) $(LDFLAGS) /OUT:empty-bases.exe empty-bases.obj

fallthrough.obj: fallthrough.c
$(CC) $(CFLAGS) fallthrough.c

Expand Down Expand Up @@ -154,6 +176,12 @@ noinline.obj: noinline.c
noinline.exe: noinline.obj
$(LD) $(LDFLAGS) /OUT:noinline.exe noinline.obj

no-escape.obj: no-escape.c
$(CC) $(CFLAGS) no-escape.c

no-escape.exe: no-escape.obj
$(LD) $(LDFLAGS) /OUT:no-escape.exe no-escape.obj

no-return.obj: no-return.c
$(CC) $(CFLAGS) no-return.c

Expand Down Expand Up @@ -220,6 +248,12 @@ stringify.obj: stringify.c
stringify.exe: stringify.obj
$(LD) $(LDFLAGS) /OUT:stringify.exe stringify.obj

unknown-cpp-attributes.obj: unknown-cpp-attributes.c
$(CC) $(CFLAGS) unknown-cpp-attributes.c

unknown-cpp-attributes.exe: unknown-cpp-attributes.obj
$(LD) $(LDFLAGS) /OUT:unknown-cpp-attributes.exe unknown-cpp-attributes.obj

unknown-pragmas.obj: unknown-pragmas.c
$(CC) $(CFLAGS) unknown-pragmas.c

Expand All @@ -238,6 +272,12 @@ unreachable.obj: unreachable.c
unreachable.exe: unreachable.obj
$(LD) $(LDFLAGS) /OUT:unreachable.exe unreachable.obj

unused-function.obj: unused-function.c
$(CC) $(CFLAGS) unused-function.c

unused-function.exe: unused-function.obj
$(LD) $(LDFLAGS) /OUT:unused-function.exe unused-function.obj

visibility.obj: visibility.c
$(CC) $(CFLAGS) visibility.c

Expand Down

0 comments on commit a79168e

Please sign in to comment.