Use ubuntu-latest with enhanced static linking for compatibility #34
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: ci | |
| on: | |
| push: | |
| branches: ['**'] # Trigger on any branch | |
| pull_request: | |
| branches: [master] | |
| # Allows for manually triggering workflow runs. | |
| workflow_dispatch: | |
| # https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions#jobs | |
| jobs: | |
| build-and-test: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout the repo | |
| uses: actions/checkout@v4 | |
| with: | |
| submodules: recursive | |
| - name: Fetch dependencies | |
| run: | | |
| sudo apt-get -qq update | |
| sudo apt-get install -y libelf-dev libssl-dev libcap-dev linux-tools-`uname -r` | |
| - name: Update toolchain | |
| run: | | |
| sudo add-apt-repository ppa:ubuntu-toolchain-r/test -y | |
| sudo apt-get update | |
| sudo apt-get install g++-12 | |
| sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-12 1 | |
| sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-12 1 | |
| - name: Build | |
| run: bazel build //src:all //src/quipper:all | |
| - name: Test | |
| run: bazel test //src:all //src/quipper:all | |
| test-deb-build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| with: | |
| submodules: recursive | |
| - name: Set up dependencies | |
| run: | | |
| sudo apt-get -qq update | |
| sudo apt-get install -y libelf-dev libssl-dev libcap-dev ruby-dev build-essential | |
| - name: Install FPM | |
| run: | | |
| sudo gem install --no-document fpm | |
| - name: Test .deb package build | |
| run: | | |
| # FPM is already installed in CI, so skip gem install | |
| FPM_SKIP_INSTALL=1 ./scripts/build-deb.sh v0.0.0-test | |
| - name: Validate .deb package | |
| run: | | |
| # Check that the package was created | |
| ls -la artifacts/ | |
| test -f artifacts/perf-data-converter_0.0.0-test_all.deb | |
| # Check package contents | |
| dpkg-deb --contents artifacts/perf-data-converter_0.0.0-test_all.deb | |
| # Check package info | |
| dpkg-deb --info artifacts/perf-data-converter_0.0.0-test_all.deb | |
| # Verify the binary is included and executable | |
| dpkg-deb --contents artifacts/perf-data-converter_0.0.0-test_all.deb | grep "perf_to_profile" | |
| - name: Test package installation | |
| run: | | |
| # Install the package | |
| sudo dpkg -i artifacts/perf-data-converter_0.0.0-test_all.deb || true | |
| sudo apt-get install -f -y # Fix any dependency issues | |
| # Test that the binary works | |
| /usr/local/bin/perf_to_profile --help || echo "Binary help test completed" | |
| # Test that it's in PATH (if /usr/local/bin is in PATH) | |
| which perf_to_profile || echo "Binary not in PATH (expected)" | |
| - name: Upload test .deb artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: test-deb-package | |
| path: artifacts/*.deb | |
| retention-days: 7 | |
| test-apt-scripts: | |
| runs-on: ubuntu-latest | |
| needs: test-deb-build | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Install reprepro | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y reprepro | |
| - name: Download test .deb package | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: test-deb-package | |
| path: ./test-artifacts | |
| - name: Test setup-apt-repo.sh script | |
| run: | | |
| echo "Testing setup-apt-repo.sh script..." | |
| ./scripts/setup-apt-repo.sh | |
| # Verify directories were created | |
| test -d conf | |
| test -d pool/main/p/perf-data-converter | |
| test -d dists | |
| # Verify configuration file was created | |
| test -f conf/distributions | |
| # Verify configuration content | |
| grep -q "Codename: focal" conf/distributions | |
| grep -q "Codename: jammy" conf/distributions | |
| grep -q "Codename: noble" conf/distributions | |
| echo "✅ setup-apt-repo.sh test passed!" | |
| - name: Test update-apt-repo.sh script | |
| run: | | |
| echo "Testing update-apt-repo.sh script..." | |
| # Copy test package to expected location | |
| mkdir -p artifacts | |
| cp test-artifacts/*.deb artifacts/ | |
| # Run the update script | |
| ./scripts/update-apt-repo.sh artifacts | |
| # Verify packages were moved to pool | |
| test -f pool/main/p/perf-data-converter/*.deb | |
| # Verify repository metadata was created | |
| test -d dists/focal | |
| test -d dists/jammy | |
| test -d dists/noble | |
| # Verify Packages files were created | |
| find dists/ -name "Packages*" | grep -q "Packages" | |
| # Verify Release files were created | |
| find dists/ -name "Release" | grep -q "Release" | |
| echo "✅ update-apt-repo.sh test passed!" | |
| - name: Test repository integrity | |
| run: | | |
| echo "Testing repository integrity..." | |
| # Test reprepro list command | |
| reprepro -b . list focal | |
| reprepro -b . list jammy | |
| reprepro -b . list noble | |
| # Verify package is listed in all suites | |
| reprepro -b . list focal | grep -q "perf-data-converter" | |
| reprepro -b . list jammy | grep -q "perf-data-converter" | |
| reprepro -b . list noble | grep -q "perf-data-converter" | |
| echo "✅ Repository integrity test passed!" |