From 54f92b9d1fb8162500d8aa85dda9284e9225ec4e Mon Sep 17 00:00:00 2001 From: Aleksa Sarai Date: Sat, 3 Aug 2024 14:04:33 +1000 Subject: [PATCH] gha: add binding smoke test workflows Signed-off-by: Aleksa Sarai --- .github/workflows/bindings.yml | 81 ++++++++++++++++++++++++++ .github/workflows/{ci.yml => rust.yml} | 2 +- 2 files changed, 82 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/bindings.yml rename .github/workflows/{ci.yml => rust.yml} (99%) diff --git a/.github/workflows/bindings.yml b/.github/workflows/bindings.yml new file mode 100644 index 00000000..bb1086e7 --- /dev/null +++ b/.github/workflows/bindings.yml @@ -0,0 +1,81 @@ +# libpathrs: safe path resolution on Linux +# Copyright (C) 2019-2024 Aleksa Sarai +# Copyright (C) 2019-2024 SUSE LLC +# +# This program is free software: you can redistribute it and/or modify it under +# the terms of the GNU Lesser General Public License as published by the Free +# Software Foundation, either version 3 of the License, or (at your option) any +# later version. +# +# This program is distributed in the hope that it will be useful, but WITHOUT ANY +# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. See the GNU General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public License along +# with this program. If not, see . + +on: + push: + branches: [ main ] + pull_request: + branches: [ main ] + release: + types: [ published ] + schedule: + - cron: '0 0 * * *' + +name: bindings-ci + +jobs: + c: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: dtolnay/rust-toolchain@stable + - name: build libpathrs + run: make release + - name: install libpathrs + run: sudo ./install.sh --libdir=/usr/lib + - run: make -C examples/c smoke-test + + go: + strategy: + fail-fast: false + matrix: + go-version: [1.18.x, 1.21.x, 1.22.x] + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: dtolnay/rust-toolchain@stable + - name: build libpathrs + run: make release + - name: install libpathrs + run: sudo ./install.sh --libdir=/usr/lib + - name: install go ${{ matrix.go-version }} + uses: actions/setup-go@v5 + with: + go-version: ${{ matrix.go-version }} + check-latest: true + - run: make -C examples/go smoke-test + + python: + strategy: + fail-fast: false + matrix: + python-version: [3.8, 3.10, 3.12] + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: dtolnay/rust-toolchain@stable + - name: build libpathrs + run: make release + - name: install libpathrs + run: sudo ./install.sh --libdir=/usr/lib + - uses: actions/setup-python@v5 + with: + python-version: ${{ matrix.python-version }} + - name: build python-libpathrs bindings + run: make -C contrib/bindings/python dist + - name: install python-libpathrs bindings + run: make -C contrib/bindings/python install + - run: make -C examples/python smoke-test diff --git a/.github/workflows/ci.yml b/.github/workflows/rust.yml similarity index 99% rename from .github/workflows/ci.yml rename to .github/workflows/rust.yml index 987c4b98..bf1fa304 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/rust.yml @@ -24,7 +24,7 @@ on: schedule: - cron: '0 0 * * *' -name: ci +name: rust-ci jobs: check: