X-Git-Url: https://tinc-vpn.org/git/browse?a=blobdiff_plain;f=.github%2Fworkflows%2Ftest.yml;h=4a250d4d2c0031e515c51ed4970b3cfe7ed645b6;hb=402170d78f4413d0b95a5ac194db4f638021961a;hp=a9253ab626a440367a6fd088d74633c6db7879ee;hpb=ee2d78fa6fbef174ebe91c14de857e2ed46e8127;p=tinc diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index a9253ab6..4a250d4d 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -10,6 +10,7 @@ on: jobs: code-style: runs-on: ubuntu-latest + timeout-minutes: 5 steps: - name: Checkout code uses: actions/checkout@v2 @@ -42,10 +43,12 @@ jobs: sanitizer: runs-on: ubuntu-latest + timeout-minutes: 10 strategy: fail-fast: false matrix: sanitizer: + - address - thread - undefined env: @@ -86,6 +89,7 @@ jobs: linux: runs-on: ubuntu-latest + timeout-minutes: 10 strategy: fail-fast: false matrix: @@ -103,20 +107,21 @@ jobs: container: image: ${{ matrix.os }} options: --privileged - + env: + CI: 1 steps: - name: Install deps (Alpine) run: > apk add git binutils make autoconf automake gcc linux-headers libtool diffutils texinfo procps openssl-dev zlib-dev lzo-dev ncurses-dev - readline-dev musl-dev lz4-dev socat + readline-dev musl-dev lz4-dev socat shadow sudo if: startsWith(matrix.os, 'alpine') - name: Install deps (Debian and Ubuntu) shell: bash run: | apt-get update - apt-get install -y git binutils make autoconf automake gcc diffutils \ + apt-get install -y git binutils make autoconf automake gcc diffutils sudo \ texinfo netcat procps socat zlib1g-dev lib{ssl,lzo2,lz4,ncurses,readline}-dev env: DEBIAN_FRONTEND: noninteractive @@ -130,14 +135,15 @@ jobs: dnf config-manager --enable powertools fi yum install -y epel-release - yum install -y git binutils make autoconf automake gcc diffutils \ - texinfo netcat procps socat {lzo,zlib,lz4,openssl11,ncurses,readline}-devel + yum install -y git binutils make autoconf automake gcc diffutils sudo \ + texinfo netcat procps socat {lzo,zlib,lz4,ncurses,readline}-devel + yum install -y openssl11-devel || yum install -y openssl-devel if: startsWith(matrix.os, 'centos') || startsWith(matrix.os, 'alma') - name: Install deps (SUSE) shell: bash run: > - zypper install -y tar git binutils make autoconf automake gcc procps + zypper install -y tar git binutils make autoconf automake gcc procps sudo makeinfo diffutils gzip socat {openssl,zlib,lzo,liblz4,ncurses,readline}-devel if: startsWith(matrix.os, 'opensuse') @@ -149,11 +155,17 @@ jobs: - name: Assign name for test results artifact run: echo TEST_ARTIFACT="$(echo '${{ matrix.os }}' | sed 's|[:/]|_|g')" >>"$GITHUB_ENV" + - name: Create a non-privileged user + run: | + useradd --user-group build + chown -R build:build . + echo 'build ALL=(ALL) NOPASSWD: ALL' >/etc/sudoers.d/build + - name: Run tests with default settings - run: sh .github/workflows/test/run.sh default + run: sudo -u build CI=1 sh .github/workflows/test/run.sh default - name: Run tests without legacy protocol - run: sh .github/workflows/test/run.sh nolegacy + run: sudo -u build CI=1 sh .github/workflows/test/run.sh nolegacy - name: Upload test results uses: actions/upload-artifact@v2 @@ -171,6 +183,7 @@ jobs: os: [ubuntu-18.04, ubuntu-20.04] runs-on: ${{ matrix.os }} + timeout-minutes: 5 steps: - name: Checkout code @@ -219,6 +232,7 @@ jobs: os: [ubuntu-18.04, ubuntu-20.04] runs-on: ${{ matrix.os }} + timeout-minutes: 5 steps: - name: Download built packages @@ -250,6 +264,7 @@ jobs: macos: runs-on: macos-latest + timeout-minutes: 10 strategy: fail-fast: false @@ -289,6 +304,7 @@ jobs: windows: runs-on: windows-latest + timeout-minutes: 20 strategy: fail-fast: false