|
7 | 7 | workflow_dispatch: # this is a nice option that will enable a button w/ inputs |
8 | 8 | inputs: |
9 | 9 | git-ref: |
10 | | - description: Git Ref (Optional) |
| 10 | + description: Git Ref (Optional) |
11 | 11 | required: false |
| 12 | + |
| 13 | +permissions: |
| 14 | + contents: read |
| 15 | + |
| 16 | +concurrency: |
| 17 | + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} |
| 18 | + cancel-in-progress: true |
| 19 | + |
12 | 20 | jobs: |
13 | 21 | build-and-test: |
14 | 22 | name: Build and test |
15 | | - runs-on: ubuntu-latest |
| 23 | + runs-on: ubuntu-24.04 |
| 24 | + timeout-minutes: 30 |
16 | 25 | steps: |
17 | 26 | - name: Checkout code |
18 | | - uses: actions/checkout@v4 |
| 27 | + uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 |
19 | 28 |
|
20 | | - - uses: actions/setup-python@v4 |
| 29 | + - name: Set up Python |
| 30 | + uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0 |
| 31 | + with: |
| 32 | + python-version: '3.12' |
21 | 33 |
|
22 | 34 | - name: Install build dependencies |
23 | 35 | run: | |
24 | 36 | sudo apt-get update |
25 | | - sudo apt-get install valgrind gcc ninja-build meson libglib2.0-dev libfuse3-dev |
| 37 | + sudo apt-get install -y valgrind gcc ninja-build libglib2.0-dev libfuse3-dev openssh-server openssh-client fuse3 |
| 38 | +
|
| 39 | + - name: Check FUSE availability |
| 40 | + run: | |
| 41 | + test -e /dev/fuse |
| 42 | + command -v fusermount3 |
26 | 43 |
|
27 | 44 | - name: Install meson |
28 | | - run: pip3 install meson pytest |
| 45 | + run: pip3 install meson pytest pytest-timeout |
29 | 46 |
|
30 | 47 | - name: build |
31 | 48 | run: | |
32 | | - mkdir build; cd build |
33 | | - meson .. |
34 | | - ninja |
| 49 | + meson setup build |
| 50 | + ninja -C build |
35 | 51 |
|
36 | 52 | # cd does not persist across steps |
37 | 53 | - name: upload build artifact |
38 | | - uses: actions/upload-artifact@v4 |
| 54 | + uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 |
39 | 55 | with: |
40 | 56 | name: sshfs |
41 | 57 | path: build/sshfs |
| 58 | + if-no-files-found: ignore |
42 | 59 |
|
43 | | - - name: make ssh into localhost without prompt possible for tests |
| 60 | + - name: Setup SSH |
44 | 61 | run: | |
45 | | - ssh-keygen -b 2048 -t rsa -f ~/.ssh/id_rsa -q -N "" |
| 62 | + mkdir -p ~/.ssh |
| 63 | + chmod 700 ~/.ssh |
| 64 | + ssh-keygen -b 2048 -t rsa -f ~/.ssh/id_rsa -q -N "" |
46 | 65 | cat ~/.ssh/id_rsa.pub > ~/.ssh/authorized_keys |
| 66 | + chmod 600 ~/.ssh/authorized_keys |
| 67 | + sudo systemctl start ssh || sudo service ssh start |
| 68 | + ssh -o StrictHostKeyChecking=no -o BatchMode=yes localhost true |
47 | 69 |
|
48 | 70 | - name: run tests |
49 | 71 | run: | |
50 | 72 | cd build |
51 | | - python3 -m pytest test/ |
| 73 | + python3 -m pytest test/ --timeout=300 --junitxml=test-results.xml --maxfail=99 |
| 74 | + timeout-minutes: 20 |
| 75 | + |
| 76 | + - name: upload test results |
| 77 | + uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 |
| 78 | + if: always() |
| 79 | + with: |
| 80 | + name: test-results |
| 81 | + path: | |
| 82 | + build/test-results.xml |
| 83 | + build/meson-logs/ |
0 commit comments