ci: use containers

GitHub's CI default runners are full of all kinds of software, and this
can cause hard to reproduce errors. Luckly, GitHub Actions supports
running jobs in a container image, so that the build environment is
minimal and reprocucible.

This patch changes the main CI job to run in a Debian Testing container,
fixing the issues described in
<cfb1127c3b>.

As Debian Testing is a semi-rolling relase distribution, and nasm 2.15
is shipped by default, I've also modified the script to install nasm
from apt instead of building it from source.
This commit is contained in:
Andrea Pappacoda 2022-12-02 14:58:59 +01:00
parent bb70083e64
commit fbb18f69d5
No known key found for this signature in database
GPG key ID: 4A9208A2455077A7
2 changed files with 14 additions and 10 deletions

View file

@ -1,15 +1,21 @@
name: test name: test
on: [push] on: [push]
defaults:
run:
shell: sh
permissions:
contents: read
jobs: jobs:
build: test:
name: test
runs-on: ubuntu-latest runs-on: ubuntu-latest
container:
image: debian:testing
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v3
- run: sudo apt update - run: apt -y update
- run: sudo apt install yasm g++-multilib tcsh - run: apt -y install g++-multilib libboost-dev make nasm yasm
- run: wget https://www.nasm.us/pub/nasm/releasebuilds/2.15.05/nasm-2.15.05.tar.gz
- run: tar xvfz nasm-2.15.05.tar.gz && cd nasm-2.15.05 && ./configure && make && sudo make install && cd ..
- run: make test - run: make test
- run: make -C sample CXXFLAGS="-DXBYAK_NO_EXCEPTION" - run: make -C sample CXXFLAGS="-DXBYAK_NO_EXCEPTION"

View file

@ -1,9 +1,7 @@
XBYAK_INC=../xbyak/xbyak.h XBYAK_INC=../xbyak/xbyak.h
CXX?=g++ CXX?=g++
#BOOST_EXIST=$(shell echo "#include <boost/spirit/core.hpp>" | $(CXX) -x c++ -c - 2>/dev/null && echo 1) BOOST_EXIST=$(shell echo "#include <boost/spirit/core.hpp>" | $(CXX) -x c++ -c - 2>/dev/null && echo 1)
# I don't know why the above code causes an error on GitHub action.
BOOST_EXIST?=0
UNAME_M=$(shell uname -m) UNAME_M=$(shell uname -m)
ONLY_64BIT=0 ONLY_64BIT=0