Skip to content

Commit 28bdaa7

Browse files
authored
build deb packages via github ci (#40)
* build deb packages via github ci * chore: minor styling changes * switch to node v24
1 parent 66a565d commit 28bdaa7

File tree

7 files changed

+608
-460
lines changed

7 files changed

+608
-460
lines changed

.devcontainer/devcontainer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"image": "mcr.microsoft.com/devcontainers/base:ubuntu",
33
"features": {
44
"node": {
5-
"version": "22"
5+
"version": "24"
66
}
77
},
88
"customizations": {
Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
name: build espresso
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
espresso_version:
7+
description: Quantum espresso version (e.g., 7.5)
8+
type: string
9+
default: 7.5
10+
build_iteration:
11+
description: Build iteration
12+
type: number
13+
default: 1
14+
15+
jobs:
16+
build-espresso:
17+
runs-on: ${{ matrix.os }}
18+
strategy:
19+
matrix:
20+
os:
21+
- ubuntu-24.04
22+
- ubuntu-24.04-arm
23+
permissions:
24+
contents: read
25+
steps:
26+
- uses: actions/checkout@v5
27+
28+
- name: Set ENV variables
29+
run: |
30+
version=${{ inputs.espresso_version }}
31+
iteration=${{ inputs.build_iteration }}
32+
dependencies=$(cat .github/workflows/build-manifest.json | jq -r '(.dependencies // []) | map("--depends " + .) | join(" ")')
33+
arch=$(uname -m)
34+
echo "QE_VER=$version" >> "$GITHUB_ENV"
35+
echo "ITERATION=$iteration" >> "$GITHUB_ENV"
36+
echo "FPM_DEPS=$dependencies" >> "$GITHUB_ENV"
37+
echo "ARCH=$arch" >> "$GITHUB_ENV"
38+
39+
- name: Install build tools
40+
run: sudo apt update && sudo apt install -y $(cat .github/workflows/build-manifest.json | jq -r '(.build_tools // []) | join(" ")')
41+
42+
- name: Setup fpm
43+
run: sudo apt install -y ruby && sudo gem install fpm
44+
45+
- name: Install dependencies
46+
run: sudo apt install -y $(cat .github/workflows/build-manifest.json | jq -r '(.dependencies // []) | join(" ")')
47+
48+
- name: Build espresso
49+
run: |
50+
INSTALL_PREFIX=/opt/espresso/${QE_VER}
51+
wget https://gitlab.com/QEF/q-e/-/archive/qe-${QE_VER}/q-e-qe-${QE_VER}.tar.gz
52+
tar -xf q-e-qe-${QE_VER}.tar.gz
53+
cd q-e-qe-${QE_VER}
54+
55+
./configure CC=mpicc FC=mpifort F77=mpifort F90=mpifort \
56+
MPIF90=mpif90 --prefix=${INSTALL_PREFIX} --enable-openmp
57+
make -j$(nproc) all
58+
cd EPW
59+
make -j$(nproc) all
60+
cd ../GWW/util
61+
FC=mpifort make all
62+
cd ../..
63+
sudo make install
64+
65+
- name: Build deb package
66+
run: |
67+
fpm --verbose \
68+
--force \
69+
--debug \
70+
--workdir "/tmp" \
71+
--input-type "dir" \
72+
--output-type "deb" \
73+
--deb-user "root" \
74+
--deb-group "root" \
75+
--chdir "/opt/espresso/${QE_VER}/bin" \
76+
--name "quantum-espresso" \
77+
--prefix "/opt/espresso/${QE_VER}" \
78+
--version "${QE_VER}" \
79+
--iteration "${ITERATION}" \
80+
--url "https://github.com/pranabdas/espresso" \
81+
--maintainer "https://pranabdas.github.io" \
82+
--architecture "$ARCH" \
83+
--description "Quantum Espresso ${QE_VER} parallel GNU build for 24.04 LTS." ${FPM_DEPS}
84+
85+
- uses: actions/upload-artifact@v4
86+
if: runner.arch == 'X64'
87+
with:
88+
name: quantum-espresso_${{ inputs.espresso_version }}-${{ inputs.build_iteration }}_amd64.deb
89+
path: quantum-espresso_${{ inputs.espresso_version }}-${{ inputs.build_iteration }}_amd64.deb
90+
91+
- uses: actions/upload-artifact@v4
92+
if: runner.arch == 'ARM64'
93+
with:
94+
name: quantum-espresso_${{ inputs.espresso_version }}-${{ inputs.build_iteration }}_arm64.deb
95+
path: quantum-espresso_${{ inputs.espresso_version }}-${{ inputs.build_iteration }}_arm64.deb
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
{
2+
"build_tools": [
3+
"autoconf",
4+
"build-essential",
5+
"ca-certificates",
6+
"git",
7+
"wget"
8+
],
9+
"dependencies": [
10+
"gcc",
11+
"gfortran",
12+
"libblas3",
13+
"libopenblas-dev",
14+
"libc6",
15+
"libfftw3-dev",
16+
"libgcc-s1",
17+
"liblapack-dev",
18+
"libopenmpi-dev",
19+
"libscalapack-openmpi-dev",
20+
"libelpa-dev"
21+
]
22+
}

.github/workflows/deploy-gh-pages.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,12 @@ jobs:
1616
group: ${{ github.workflow }}-${{ github.ref }}
1717

1818
steps:
19-
- uses: actions/checkout@v4
19+
- uses: actions/checkout@v5
2020

2121
- name: Prepare Node environment
2222
uses: actions/setup-node@v4
2323
with:
24-
node-version: '22'
24+
node-version: '24'
2525

2626
- name: Install NPM packages
2727
run: npm install

0 commit comments

Comments
 (0)