diff --git a/.github/workflows/host_tools.yml b/.github/workflows/host_tools.yml new file mode 100644 index 0000000..a79b94b --- /dev/null +++ b/.github/workflows/host_tools.yml @@ -0,0 +1,76 @@ +name: Host Tools + +on: + push: + paths: + - 'usbhostfs_pc/**' + - '.github/workflows/host_tools.yml' + pull_request: + paths: + - 'usbhostfs_pc/**' + - '.github/workflows/host_tools.yml' + repository_dispatch: + types: [run_build] + workflow_dispatch: {} + +jobs: + build: + runs-on: ${{ matrix.os[0] }} + strategy: + matrix: + os: [ + [macos-latest, arm64, bash], + [macos-13, x86_64, bash], + [ubuntu-latest, x86_64, bash] + ] + fail-fast: false + defaults: + run: + shell: ${{ matrix.os[2] }} {0} + + steps: + - uses: actions/checkout@v4 + + - name: Install Ubuntu packages + if: matrix.os[0] == 'ubuntu-latest' + run: | + sudo apt-get update + sudo apt-get -y install libusb-1.0-0-dev libusb-dev gcc + + - name: Install macOS packages + if: startsWith(matrix.os[0], 'macos') + run: | + brew update + brew install libusb gcc + + - name: Compile tools + run: | + make --quiet -j $PROC_NR -C usbhostfs_pc + + build-docker: + runs-on: ubuntu-latest + container: ${{ matrix.os[0] }}:latest + strategy: + matrix: + os: [ + [ubuntu, bash], + [fedora, bash], + ] + fail-fast: false + steps: + - uses: actions/checkout@v2 + + - name: Install dependencies Ubuntu + if: matrix.os[0] == 'ubuntu' + run: | + apt-get -y update + DEBIAN_FRONTEND="noninteractive" TZ="Europe/London" apt-get -y install libusb-1.0-0-dev libusb-dev gcc make pkg-config + + - name: Install dependencies Fedora + if: matrix.os[0] == 'fedora' + run: | + dnf -y install gcc make libusb1-devel libusb-compat-0.1-devel + + - name: Compile tools + run: | + make --quiet -j $PROC_NR -C usbhostfs_pc diff --git a/usbhostfs_pc/main.c b/usbhostfs_pc/main.c index 173dbe2..f7eee9c 100644 --- a/usbhostfs_pc/main.c +++ b/usbhostfs_pc/main.c @@ -15,7 +15,7 @@ #include #include #include -#include +#include #include #include #include