Repository navigation
50 lines (48 loc) · 1.63 KB
/
Copy pathbuild_test_makefile.yml
File metadata and controls
50 lines (48 loc) · 1.63 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
name: Build Test
on:
push:
pull_request:
defaults:
run:
shell: bash
jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
include:
- tag: intel
build_args: "CXX=mpiicpx ELPA_LIB_DIR=/usr/local/lib ELPA_INCLUDE_DIR=/usr/local/include CEREAL_DIR=/usr/include/cereal OPENMP=ON"
name: "Build with Makefile & Intel compilers"
name: ${{ matrix.name }}
steps:
- name: Checkout
uses: actions/checkout@v7.0.1
# A job-level container is pulled before steps run, so cleanup must happen
# on the hosted runner before starting the large Intel toolchain image.
- name: Free disk space before pulling the build image
run: |
df -h /
sudo rm -rf /usr/share/dotnet /usr/local/lib/android /opt/ghc
docker image prune --all --force
df -h /
- name: Build
env:
BUILD_IMAGE: ghcr.io/deepmodeling/abacus-${{ matrix.tag }}
BUILD_ARGS: ${{ matrix.build_args }}
# Keep the same image and build command as the container job.
run: |
docker run --rm \
--volume "$GITHUB_WORKSPACE:/workspace" \
--workdir /workspace \
--env BUILD_ARGS \
--env I_MPI_CXX=icpx \
--entrypoint /bin/bash \
"$BUILD_IMAGE" -e -c '
git config --global --add safe.directory /workspace
apt update && apt install -y nlohmann-json3-dev
chmod a+x generate_build_info.sh
cd source
mkdir -p build && cd build
make -f ../Makefile -j2 $BUILD_ARGS
'