[harpocrates] Work around the Harpocrates parser #2884
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: Antlir Tests | |
on: [push, pull_request] | |
jobs: | |
test: | |
runs-on: ubuntu-20.04 | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Checkout submodules | |
run: git submodule update --init | |
- name: Install system dependencies | |
run: | | |
sudo apt-get update | |
sudo apt-get install -y attr libcap-ng-dev systemd-container libzstd-dev openssh-client | |
# createrepo_c is not packaged for Ubuntu 20.04. Until it is or until we | |
# can use a hosted runner that is based on CentOS (or Fedora), compile | |
# createrepo_c so that unit tests are able to use it to make ephemeral | |
# rpm repositories. | |
- name: Build createrepo_c | |
run: | | |
sudo apt-get install libssl-dev liblzma-dev libxml2-dev libmagic-dev libcurl4-openssl-dev libbz2-dev librpm-dev | |
curl -L https://github.com/rpm-software-management/createrepo_c/archive/0.16.2.tar.gz | gunzip | tar -x | |
cd createrepo_c-0.16.2 | |
mkdir build && cd build | |
cmake .. -DENABLE_DRPM=0 -DWITH_ZCHUNK=0 -DWITH_LIBMODULEMD=0 -DENABLE_PYTHON=0 | |
make -j$(nproc) | |
mv src/createrepo_c $GITHUB_WORKSPACE/tools/ | |
working-directory: /tmp | |
- name: Set up $PATH | |
run: echo $(pwd)/tools > $GITHUB_PATH | |
# antlir is primarily developed on CentOS, which has a 'nobody:nobody' | |
# user and group. GitHub actions is running on ubuntu which uses | |
# 'nobody:nogroup', so create a 'nobody' group to use | |
- name: Set up nobody group | |
run: sudo groupadd nobody; sudo usermod -aG nobody nobody | |
- uses: actions/setup-python@v2 | |
with: | |
python-version: "~3.9" | |
- uses: dtolnay/rust-toolchain@master | |
with: | |
toolchain: nightly-2021-03-25 | |
- name: Fetch buck | |
run: buck --version | |
# Make it very clear if a failure is due to the target graph being | |
# unparseable, or an actual build failure. | |
- name: Validate target graph | |
run: buck targets //... | |
- name: Fetch remote artifacts | |
run: buck fetch //... | |
- name: Build tests | |
run: buck build --keep-going $(buck query @tools/testinfra/ci_tests_query) | |
# This is not quite a test, but exercises a lot of antlir and is expected | |
# to pass, unlike the unit tests below, not all of which have been fixed | |
# to support the OSS build | |
- name: Build base image(s) | |
run: buck build //images/base/... | |
- name: Run cxx tests | |
# TODO(vmagro): cxx_tests are excluded from 'buck test' because the | |
# test runner assumes that test output ends up in a certain spot on the | |
# host, and we have so few of these it doesn't make sense to invest in | |
# fixing our wrappers for both internal and external use for right now. | |
run: buck query 'kind(cxx_test, //...)' | xargs -n1 buck run | |
continue-on-error: true | |
# Run all tests, excluding any that are disabled (mainly the hidden | |
# layer tests) | |
- name: Run tests | |
run: buck test --always-exclude $(buck query @tools/testinfra/ci_tests_query) --xml tests.xml | |
- name: Post-process tests.xml | |
if: success() || failure() | |
run: | | |
sed -e 's///g' -i tests.xml | |
buck run //tools/testinfra:buck2junit -- -s:tests.xml -o:tests-junit.xml | |
- uses: actions/upload-artifact@v2 | |
if: success() || failure() | |
with: | |
name: test-results | |
path: tests-junit.xml |