From e5f4fcaad7214c11c21cd5be6932a89b939b3abe Mon Sep 17 00:00:00 2001 From: h4sh Date: Sat, 23 Sep 2023 23:00:12 +1000 Subject: [PATCH] github action build+test --- .github/workflows/build-ubuntu.yml | 51 ++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 .github/workflows/build-ubuntu.yml diff --git a/.github/workflows/build-ubuntu.yml b/.github/workflows/build-ubuntu.yml new file mode 100644 index 00000000..c7a70471 --- /dev/null +++ b/.github/workflows/build-ubuntu.yml @@ -0,0 +1,51 @@ +name: build and test +on: + push: + + pull_request: + + workflow_dispatch: # this is a nice option that will enable a button w/ inputs + inputs: + git-ref: + description: Git Ref (Optional) + required: false +jobs: + build-and-test: + name: Build and test + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v3 + + - uses: actions/setup-python@v4 + + - name: Install build dependencies + run: | + sudo apt-get update + sudo apt-get install valgrind gcc ninja-build meson libglib2.0-dev libfuse3-dev + + - name: Install meson + run: pip3 install meson pytest + + - name: build + run: | + mkdir build; cd build + meson .. + ninja + + # cd does not persist across steps + - name: upload build artifact + uses: actions/upload-artifact@v3 + with: + name: sshfs + path: build/sshfs + + - name: make ssh into localhost without prompt possible for tests + run: | + ssh-keygen -b 2048 -t rsa -f ~/.ssh/id_rsa -q -N "" + cat ~/.ssh/id_rsa.pub > ~/.ssh/authorized_keys + + - name: run tests + run: | + cd build + python3 -m pytest test/