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

added github action for windows builds #89

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 0 additions & 24 deletions .appveyor.yml

This file was deleted.

90 changes: 90 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
name: CI

on:
push:
branches:
- master
pull_request:
types: [opened, synchronize, reopened]

env:
BRANCH_NAME: ${{ github.head_ref || github.ref_name }}

jobs:
windows:
runs-on: windows-latest
steps:
- name: Clone
id: checkout
uses: actions/checkout@v1

- name: Add msbuild to PATH
uses: microsoft/[email protected]
with:
msbuild-architecture: x64

- uses: ilammy/msvc-dev-cmd@v1

- name: Install OpenCL
run: .\fetch-opencl-dev-win.cmd x64

- name: Build
id: build_script
run: .\make.cmd

- name: Test
run: .\clinfo.exe

- name: Upload artifacts
if: ${{ ( github.event_name == 'push' && github.ref == 'refs/heads/master' ) || github.event.inputs.create_release == 'true' }}
uses: actions/upload-artifact@v3
with:
path: |
clinfo.exe

release:
if: ${{ ( github.event_name == 'push' && github.ref == 'refs/heads/master' ) || github.event.inputs.create_release == 'true' }}

runs-on: ubuntu-latest

needs:
- windows

steps:
- name: Download artifacts
id: download-artifact
uses: actions/download-artifact@v3

- name: Get commit hash
id: commit
uses: pr-mpt/actions-commit-hash@v2

- name: Create release
id: create_release
uses: anzz1/action-create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ env.BRANCH_NAME }}-${{ steps.commit.outputs.short }}

- name: Upload release
id: upload_release
uses: actions/github-script@v3
with:
github-token: ${{secrets.GITHUB_TOKEN}}
script: |
const path = require('path');
const fs = require('fs');
const release_id = '${{ steps.create_release.outputs.id }}';
for (let file of await fs.readdirSync('./artifact')) {
if (path.extname(file) === '.exe') {
console.log('uploadReleaseAsset', file);
await github.repos.uploadReleaseAsset({
owner: context.repo.owner,
repo: context.repo.repo,
release_id: release_id,
name: file,
data: await fs.readFileSync(`./artifact/${file}`)
});
}
}
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
clinfo
.*.swp
*.o
include/
lib/
*.exe
OpenCL.lib
*.pdb
*.obj
23 changes: 13 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
# Warning

**This is modified and not designed to be a 1-to-1 clone of [Oblomov/clinfo](https://github.com/Oblomov/clinfo)**

Please see [Oblomov/clinfo](https://github.com/Oblomov/clinfo)

# What is this?

clinfo is a simple command-line application that enumerates all possible
Expand All @@ -22,14 +28,14 @@ Refer to the man page for further information.

## Use cases

* verify that your OpenCL environment is set up correctly;
- verify that your OpenCL environment is set up correctly;
if `clinfo` cannot find any platform or devices (or fails to load
the OpenCL dispatcher library), chances are high no other OpenCL
application will run;
* verify that your OpenCL _development_ environment is set up
- verify that your OpenCL _development_ environment is set up
correctly: if `clinfo` fails to build, chances are high no
other OpenCL application will build;
* explore/report the actual properties of the available device(s).
- explore/report the actual properties of the available device(s).

## Segmentation faults

Expand All @@ -47,7 +53,6 @@ properties or as extensions), but are not shown by `clinfo`, please [open
an issue](https://github.com/Oblomov/clinfo/issues) providing as much
information as you can. Patches and pull requests accepted too.


# Building

<img
Expand Down Expand Up @@ -76,15 +81,14 @@ as well as via F-Droid.

Inside Termux, you will first need to install some common tools:

pkg install git make clang -y

pkg install git make clang -y

You will also need to clone the `clinfo` repository, and fetch the
OpenCL headers (we'll use the official `KhronosGroup/OpenCL-Headers`
repository for that):

git clone https://github.com/Oblomov/clinfo
git clone https://github.com/KhronosGroup/OpenCL-Headers
git clone https://github.com/Oblomov/clinfo
git clone https://github.com/KhronosGroup/OpenCL-Headers

(I prefer doing this from a `src` directory I have created for
development, but as long as `clinfo` and `OpenCL-Headers` are sibling
Expand All @@ -98,7 +102,7 @@ You can then `cd clinfo` and build the application. You can try simply
running `make` since Android should be autodetected now, buf it
this fails you can also force the detectio with

make OS=Android
make OS=Android

If linking fails due to a missing `libOpenCL.so`, then your Android
machine probably doesn't support OpenCL. Otherwise, you should have a
Expand Down Expand Up @@ -131,7 +135,6 @@ you can use

make OS=Homebrew


## Windows support

The application can usually be built in Windows too (support for which
Expand Down
Loading