Merge branch 'main' into min-version #202
Workflow file for this run
This file contains 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: Main CI | |
on: [push, pull_request] | |
jobs: | |
build: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [ubuntu-20.04, ubuntu-22.04] | |
defaults: | |
run: | |
shell: bash | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
with: | |
ref: ${{ github.event.sha }} | |
fetch-depth: 0 | |
fetch-tags: true | |
- name: Get tags from upstream, if needed | |
if: github.repository != 'Azure/azure-vm-utils' | |
run: | | |
git remote add upstream https://github.com/Azure/azure-vm-utils.git | |
git fetch upstream --tags | |
- name: Setup | |
run: | | |
sudo apt update | |
sudo apt install gcc pandoc cmake -y | |
- name: Build & install project with cmake | |
run: | | |
cmake -B build -S . | |
make -C build | |
sudo make -C build install | |
- name: Verify installation | |
run: | | |
test -f /usr/local/sbin/azure-nvme-id | |
test -f /usr/local/share/man/man8/azure-nvme-id.8 | |
test -f /usr/local/lib/udev/rules.d/80-azure-disk.rules | |
azure-nvme-id --version | |
- name: Verify manpages are not generated by default | |
run: | | |
rm -rf build | |
cmake -B build -S . | |
make -C build | |
if grep -c "Pandoc" build/doc/azure-nvme-id.8; then echo "manpage unexpectedly generated by pandoc"; exit 1; fi | |
- name: Verify manpages are not generated with -DGENERATE_MANPAGES=0 | |
run: | | |
rm -rf build | |
cmake -DGENERATE_MANPAGES=0 -B build -S . | |
make -C build | |
if grep -c "Pandoc" build/doc/azure-nvme-id.8; then echo "manpage unexpectedly generated by pandoc"; exit 1; fi | |
- name: Verify manpages are generated with -DGENERATE_MANPAGES=1 | |
run: | | |
rm -rf build | |
cmake -DGENERATE_MANPAGES=1 -B build -S . | |
make -C build | |
if ! grep -c "Pandoc" build/doc/azure-nvme-id.8; then echo "manpage not generated by pandoc"; exit 1; fi |