Merge pull request #235 from DataDog/paulcacheux/fix-cuda-parsing #875
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: CI | |
on: | |
pull_request: | |
push: | |
branches: | |
- main | |
jobs: | |
build: | |
name: Build nikos | |
runs-on: ubuntu-20.04 | |
steps: | |
- name: Checkout source code | |
uses: actions/checkout@v4 | |
- name: Setup go | |
uses: actions/setup-go@v5 | |
with: | |
go-version: "1.20" | |
- name: Cache Go modules | |
uses: actions/cache@v3 | |
with: | |
path: | | |
~/.cache/go-build | |
~/go/pkg/mod | |
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} | |
restore-keys: | | |
${{ runner.os }}-go- | |
- name: Build nikos | |
run: bash .ci_build/build_install_nikos.sh . | |
- name: Verify build | |
run: /opt/nikos/bin/nikos | |
- name: Upload artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: nikos-archive | |
path: /opt/nikos | |
retention-days: 1 | |
verify-glibc: | |
name: Check GLIBC references | |
needs: build | |
runs-on: ubuntu-20.04 | |
steps: | |
- name: Download the nikos artifact | |
uses: actions/download-artifact@v4 | |
with: | |
name: nikos-archive | |
path: /opt/nikos | |
- name: Fail if there are references to GLIBC >= 2.18 | |
run: objdump -p /opt/nikos/bin/nikos | egrep -zqv 'GLIBC_2\.(1[8-9]|[2-9][0-9])' | |
molecule-tests: | |
name: Molecule tests | |
needs: build | |
runs-on: macos-12 | |
strategy: | |
fail-fast: false | |
matrix: | |
platform: | |
[ | |
"fedora", | |
"centos", | |
"opensuse", | |
"debian", | |
"ubuntu", | |
"oracle", | |
"amazon-linux", | |
] | |
test_type: ["host", "container"] | |
steps: | |
- name: Checkout source code | |
uses: actions/checkout@v4 | |
- uses: actions/setup-python@v5 | |
with: | |
python-version: "3.x" | |
- uses: actions/cache@v3 | |
with: | |
path: ~/Library/Caches/pip | |
key: ${{ runner.os }}-pip-${{ hashFiles('.ci_build/requirements.txt') }} | |
restore-keys: | | |
${{ runner.os }}-pip- | |
- name: Cache Vagrant boxes | |
uses: actions/cache@v3 | |
with: | |
path: ~/.vagrant.d/boxes | |
key: ${{ runner.os }}-vagrant-${{ matrix.platform }}-${{ matrix.test_type }}-${{ hashFiles('tests/molecule/**/molecule.yml') }} | |
restore-keys: | | |
${{ runner.os }}-vagrant-${{ matrix.platform }}-${{ matrix.test_type }}- | |
- name: Install pip dependencies | |
run: pip install -r .ci_build/requirements.txt | |
- name: Download the nikos artifact | |
uses: actions/download-artifact@v4 | |
with: | |
name: nikos-archive | |
path: tests/molecule/resources/playbooks/nikos-archive | |
- name: Set nikos binary executable | |
run: | | |
chmod +x tests/molecule/resources/playbooks/nikos-archive/bin/nikos | |
- name: Run molecule test | |
working-directory: tests | |
run: molecule test -s ${{ matrix.platform }}-${{ matrix.test_type }} |