mirror of https://github.com/libAthena/athena.git
172 lines
4.9 KiB
YAML
172 lines
4.9 KiB
YAML
name: Test
|
|
on:
|
|
push:
|
|
jobs:
|
|
test-linux:
|
|
name: Build Linux (GCC x86_64)
|
|
runs-on: ubuntu-20.04
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
with:
|
|
fetch-depth: 0
|
|
submodules: recursive
|
|
|
|
- name: Install dependencies
|
|
run: |
|
|
sudo apt-get -y update
|
|
sudo apt-get -y install cmake ninja-build ccache llvm-11-dev libclang-11-dev clang-11
|
|
|
|
- name: Configure ccache
|
|
uses: hendrikmuhs/ccache-action@v1
|
|
with:
|
|
key: ubuntu-20.04-gcc
|
|
max-size: 1G
|
|
|
|
- name: Build
|
|
run: |
|
|
mkdir build
|
|
cd build
|
|
cmake -GNinja -DCMAKE_BUILD_TYPE=RelWithDebInfo -DClang_DIR=/usr/lib/cmake/clang-11 -DATDNA_DYNAMIC_LLVM=OFF \
|
|
-DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache \
|
|
..
|
|
cmake --build .
|
|
|
|
- name: Test
|
|
working-directory: build
|
|
run: ./atdna-test
|
|
|
|
- name: Upload artifacts
|
|
uses: actions/upload-artifact@v2
|
|
with:
|
|
name: atdna-linux-x86_64
|
|
path: |
|
|
build/atdna/atdna
|
|
|
|
test-linux-arm64:
|
|
name: Build Linux (GCC aarch64)
|
|
runs-on: ubuntu-20.04
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
with:
|
|
fetch-depth: 0
|
|
submodules: recursive
|
|
|
|
- uses: uraimo/run-on-arch-action@v2.0.9
|
|
name: Build
|
|
id: build
|
|
with:
|
|
arch: aarch64
|
|
distro: ubuntu20.04
|
|
githubToken: ${{github.token}}
|
|
dockerRunArgs: |
|
|
--volume "${PWD}:/workspace"
|
|
install: |
|
|
apt-get -y update
|
|
apt-get -y install build-essential cmake ninja-build llvm-11-dev libclang-11-dev clang-11
|
|
run: |
|
|
mkdir /workspace/build
|
|
cd /workspace/build
|
|
cmake -GNinja -DCMAKE_BUILD_TYPE=RelWithDebInfo \
|
|
-DClang_DIR=/usr/lib/cmake/clang-11 -DATDNA_DYNAMIC_LLVM=OFF ..
|
|
cmake --build .
|
|
./atdna-test
|
|
|
|
- name: Upload artifacts
|
|
uses: actions/upload-artifact@v2
|
|
with:
|
|
name: atdna-linux-aarch64
|
|
path: |
|
|
build/atdna/atdna
|
|
|
|
test-macos:
|
|
name: Build macOS (AppleClang universal)
|
|
runs-on: macos-10.15
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
with:
|
|
fetch-depth: 0
|
|
submodules: recursive
|
|
|
|
- name: Install dependencies
|
|
run: |
|
|
brew update
|
|
brew install ninja ccache
|
|
# universal clang+llvm from macports
|
|
curl -LSfs https://axiodl.com/files/clang-11-11.1.0_1.mpkg -o /tmp/clang-11-11.1.0_1.mpkg
|
|
sudo installer -pkg /tmp/clang-11-11.1.0_1.mpkg -target /
|
|
|
|
- name: Configure ccache
|
|
uses: hendrikmuhs/ccache-action@v1
|
|
with:
|
|
key: macos-10.15-appleclang
|
|
max-size: 1G
|
|
|
|
- name: Configure CMake
|
|
run: |
|
|
cmake -B build -GNinja -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_OSX_ARCHITECTURES="x86_64;arm64" \
|
|
-DLLVM_ROOT_DIR=/opt/local/libexec/llvm-11 \
|
|
-DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache .
|
|
|
|
- name: Build
|
|
run: |
|
|
cmake --build build
|
|
dsymutil build/atdna/atdna
|
|
|
|
- name: Test
|
|
working-directory: build
|
|
run: ./atdna-test
|
|
|
|
- name: Upload artifacts
|
|
uses: actions/upload-artifact@v2
|
|
with:
|
|
name: atdna-macos-x86_64
|
|
path: |
|
|
build/atdna/atdna
|
|
build/atdna/atdna.dSYM
|
|
|
|
test-windows-msvc:
|
|
name: Build Windows (MSVC x86_64)
|
|
runs-on: windows-2019
|
|
env:
|
|
LLVM_VERSION: 10.0.1
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
with:
|
|
fetch-depth: 0
|
|
submodules: recursive
|
|
|
|
- name: Install LLVM
|
|
run: |
|
|
$TempDir = "$env:RUNNER_WORKSPACE\temp"
|
|
$Filename = "LLVM-$env:LLVM_VERSION-win64.exe"
|
|
New-Item -Path "$TempDir" -ItemType Directory -ea 0
|
|
(New-Object Net.WebClient).DownloadFile("https://axiodl.com/files/$Filename", "$TempDir\$Filename")
|
|
Start-Process "$TempDir\$Filename" -ArgumentList "/S /D=$env:RUNNER_WORKSPACE\LLVM" -Wait
|
|
|
|
- name: Install dependencies
|
|
run: choco install ninja
|
|
|
|
- name: Enable Visual Studio environment
|
|
uses: ilammy/msvc-dev-cmd@v1
|
|
|
|
- name: Configure CMake
|
|
run: |
|
|
$workspace = $env:RUNNER_WORKSPACE -replace '\\', '/'
|
|
cmake -B build -GNinja -DCMAKE_BUILD_TYPE=RelWithDebInfo `
|
|
-DCMAKE_MSVC_RUNTIME_LIBRARY=MultiThreaded `
|
|
-DLLVM_ROOT_DIR="$workspace/LLVM" .
|
|
|
|
- name: Build
|
|
run: cmake --build build
|
|
|
|
- name: Test
|
|
working-directory: build
|
|
run: ./atdna-test.exe
|
|
|
|
- name: Upload artifacts
|
|
uses: actions/upload-artifact@v2
|
|
with:
|
|
name: atdna-macos-x86_64
|
|
path: |
|
|
build/atdna/atdna.exe
|
|
build/atdna/atdna.pdb |