name: Static analysis on: pull_request jobs: ubuntu-base: runs-on: ubuntu-22.04 steps: - name: Update Packages run: | sudo apt-get update - name: Install Dependencies run: | sudo apt-get install -y \ libcppunit-dev \ zlib1g-dev \ libcurl4-openssl-dev - name: Fetch libtorrent run: | git clone https://github.com/rakshasa/libtorrent - name: Build libtorrent run: | cd libtorrent autoreconf -fiv ./configure make sudo make install DESTDIR=$GITHUB_WORKSPACE/libtorrent-dist - name: Upload Build Artifacts uses: actions/upload-artifact@v4 with: name: installed-libtorrent path: libtorrent-dist/ unit-tests-default: runs-on: ubuntu-22.04 needs: ubuntu-base steps: - name: Update Packages run: | sudo apt-get update - name: Install Dependencies run: | sudo apt-get install -y \ libcppunit-dev \ zlib1g-dev \ libcurl4-openssl-dev - name: Download Libtorrent Artifacts uses: actions/download-artifact@v4 with: name: installed-libtorrent path: ./libtorrent-dist - name: Move Artifacts to System Path run: | # Elevate permissions with sudo to safely place the files sudo cp -r ./libtorrent-dist/usr/local/* /usr/local/ rm -rf ./libtorrent-dist - uses: actions/checkout@v4 - name: Configure Project run: | autoreconf -fiv ./configure make ls /usr/local/lib/ LD_LIBRARY_PATH="$LD_LIBRARY_PATH:/usr/local/lib" make check - name: Archive test/test-suite.log if: success() || failure() uses: actions/upload-artifact@v4 with: name: test-suite.log path: test/test-suite.log unit-tests-variants: runs-on: ubuntu-22.04 needs: unit-tests-default strategy: matrix: config_flag: ["--with-xmlrpc-c", "--with-xmlrpc-tinyxml2"] steps: - name: Update Packages run: | sudo apt-get update - name: Install Dependencies run: | sudo apt-get install -y \ libcppunit-dev \ zlib1g-dev \ libcurl4-openssl-dev \ libxmlrpc-c++8-dev - name: Download Libtorrent Artifacts uses: actions/download-artifact@v4 with: name: installed-libtorrent path: ./libtorrent-dist - name: Move Artifacts to System Path run: | sudo cp -r ./libtorrent-dist/usr/local/* /usr/local/ rm -rf ./libtorrent-dist - uses: actions/checkout@v4 - name: Configure Project run: | autoreconf -fiv ./configure ${{ matrix.config_flag }} make ls /usr/local/lib/ LD_LIBRARY_PATH="$LD_LIBRARY_PATH:/usr/local/lib" make check