Skip to content

Commit

Permalink
style: prettier pre-commit hook
Browse files Browse the repository at this point in the history
  • Loading branch information
thenoursehorse committed May 17, 2024
1 parent fdcac2e commit edb16a8
Show file tree
Hide file tree
Showing 18 changed files with 304 additions and 280 deletions.
124 changes: 60 additions & 64 deletions .github/actions/setup-triqs/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,45 +24,42 @@ runs:
using: "composite"

steps:
- name: Setup Python ${{ inputs.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ inputs.python-version }}
allow-prereleases: true
- name: Setup Python ${{ inputs.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ inputs.python-version }}
allow-prereleases: true

- name: Install updates
shell: bash
run: |
sudo apt-get update &&
sudo apt-get install -y lsb-release wget software-properties-common
- name: Install updates
shell: bash
run: |
sudo apt-get update &&
sudo apt-get install -y lsb-release wget software-properties-common
- name: Install clang
shell: bash
if: ${{ contains(inputs.cc, 'clang') }}
run:
wget -O /tmp/llvm.sh https://apt.llvm.org/llvm.sh &&
sudo chmod +x /tmp/llvm.sh &&
sudo /tmp/llvm.sh ${{ inputs.llvm }} &&
sudo apt-get install -y
- name: Install clang
shell: bash
if: ${{ contains(inputs.cc, 'clang') }}
run: wget -O /tmp/llvm.sh https://apt.llvm.org/llvm.sh &&
sudo chmod +x /tmp/llvm.sh &&
sudo /tmp/llvm.sh ${{ inputs.llvm }} &&
sudo apt-get install -y
clang-${{ inputs.llvm }}
lldb-${{ inputs.llvm }}
libclang-${{ inputs.llvm }}-dev
libc++-${{ inputs.llvm }}-dev
libc++abi-${{ inputs.llvm }}-dev
libomp-${{ inputs.llvm }}-dev &&
echo "CXXFLAGS=-stdlib=libc++" >> $GITHUB_ENV
echo "CXXFLAGS=-stdlib=libc++" >> $GITHUB_ENV

- name: Install gcc
shell: bash
if: ${{ contains(inputs.cc, 'gcc') }}
run:
sudo apt-get install -y
- name: Install gcc
shell: bash
if: ${{ contains(inputs.cc, 'gcc') }}
run: sudo apt-get install -y
g++-${{ inputs.gcc-version }}

- name: Install ubuntu dependencies
shell: bash
run:
sudo apt-get install -y
- name: Install ubuntu dependencies
shell: bash
run: sudo apt-get install -y
cmake
gfortran
git
Expand All @@ -79,53 +76,52 @@ runs:
openmpi-common
python3-dev

- name: Install python dependencies
shell: bash
run:
python -m pip install
- name: Install python dependencies
shell: bash
run: python -m pip install
mako
mpi4py
h5py
numpy
scipy
clang

- name: Setup clang environment
shell: bash
if: ${{ contains(inputs.cc, 'clang') }}
run: |
echo "CC=${{ inputs.cc }}-${{ inputs.llvm }}" >> $GITHUB_ENV
echo "CXX=${{ inputs.cxx }}-${{ inputs.llvm }}" >> $GITHUB_ENV
- name: Setup clang environment
shell: bash
if: ${{ contains(inputs.cc, 'clang') }}
run: |
echo "CC=${{ inputs.cc }}-${{ inputs.llvm }}" >> $GITHUB_ENV
echo "CXX=${{ inputs.cxx }}-${{ inputs.llvm }}" >> $GITHUB_ENV
- name: Setup gcc environment
shell: bash
if: ${{ contains(inputs.cc, 'gcc') }}
run: |
echo "CC=${{ inputs.cc }}-${{ inputs.gcc-version }}" >> $GITHUB_ENV
echo "CXX=${{ inputs.cxx }}-${{ inputs.gcc-version }}" >> $GITHUB_ENV
- name: Setup gcc environment
shell: bash
if: ${{ contains(inputs.cc, 'gcc') }}
run: |
echo "CC=${{ inputs.cc }}-${{ inputs.gcc-version }}" >> $GITHUB_ENV
echo "CXX=${{ inputs.cxx }}-${{ inputs.gcc-version }}" >> $GITHUB_ENV
- name: Cache build TRIQS
id: build-triqs
uses: actions/cache@v4
with:
path: triqs
key: triqs-${{ inputs.os }}-${{ inputs.python-version }} ${{ inputs.cc }}-${{ inputs.llvm }}-${{ inputs.gcc-version }}
- name: Cache build TRIQS
id: build-triqs
uses: actions/cache@v4
with:
path: triqs
key: triqs-${{ inputs.os }}-${{ inputs.python-version }} ${{ inputs.cc }}-${{ inputs.llvm }}-${{ inputs.gcc-version }}

- name: Build TRIQS
shell: bash
if: steps.build-triqs.outputs.cache-hit != 'true'
run: |
git clone https://github.com/TRIQS/triqs
mkdir triqs/build && cd triqs/build
cmake .. -DCMAKE_INSTALL_PREFIX=$HOME/triqs_install -DBuild_Documentation=OFF -DBuild_Tests=OFF
make -j1 VERBOSE=1
cd ../../
- name: Build TRIQS
shell: bash
if: steps.build-triqs.outputs.cache-hit != 'true'
run: |
git clone https://github.com/TRIQS/triqs
mkdir triqs/build && cd triqs/build
cmake .. -DCMAKE_INSTALL_PREFIX=$HOME/triqs_install -DBuild_Documentation=OFF -DBuild_Tests=OFF
make -j1 VERBOSE=1
cd ../../
- name: Install TRIQS
shell: bash
run: |
cd triqs/build && make install && cd ../../
echo "TRIQS_INSTALL=$HOME/triqs_install" >> $GITHUB_ENV
- name: Install TRIQS
shell: bash
run: |
cd triqs/build && make install && cd ../../
echo "TRIQS_INSTALL=$HOME/triqs_install" >> $GITHUB_ENV
branding:
icon: "package"
Expand Down
119 changes: 59 additions & 60 deletions .github/workflows/cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,61 +11,60 @@ concurrency:
cancel-in-progress: true

jobs:

bump-version:
runs-on: ubuntu-latest
permissions:
id-token: write
contents: write

steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Bump version and push tag
id: tag_version
uses: mathieudutour/[email protected]
with:
github_token: ${{ secrets.GITHUB_TOKEN }}

- name: Create a GitHub release
uses: ncipollo/release-action@v1
with:
tag: ${{ steps.tag_version.outputs.new_tag }}
name: Release ${{ steps.tag_version.outputs.new_tag }}
body: ${{ steps.tag_version.outputs.changelog }}
- uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Bump version and push tag
id: tag_version
uses: mathieudutour/[email protected]
with:
github_token: ${{ secrets.GITHUB_TOKEN }}

- name: Create a GitHub release
uses: ncipollo/release-action@v1
with:
tag: ${{ steps.tag_version.outputs.new_tag }}
name: Release ${{ steps.tag_version.outputs.new_tag }}
body: ${{ steps.tag_version.outputs.changelog }}

build-docs:
needs: [bump-version]
runs-on: ubuntu-22.04

steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Setup Python 3.10 and TRIQS
uses: ./.github/actions/setup-triqs
with:
python-version: "3.10"

- name: Install risb and docs dependencies
run: |
source $TRIQS_INSTALL/share/triqs/triqsvars.sh
python -m pip install .[docs]
- name: Build docs
run: |
source $TRIQS_INSTALL/share/triqs/triqsvars.sh
sphinx-apidoc -o docs/api --module-first --no-toc --force --separate src/risb
sphinx-build -b html -n -T docs docs/_build
- name: Upload docs artifact
uses: actions/upload-artifact@v4
with:
name: docs-build
path: docs/_build
- uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Setup Python 3.10 and TRIQS
uses: ./.github/actions/setup-triqs
with:
python-version: "3.10"

- name: Install risb and docs dependencies
run: |
source $TRIQS_INSTALL/share/triqs/triqsvars.sh
python -m pip install .[docs]
- name: Build docs
run: |
source $TRIQS_INSTALL/share/triqs/triqsvars.sh
sphinx-apidoc -o docs/api --module-first --no-toc --force --separate src/risb
sphinx-build -b html -n -T docs docs/_build
- name: Upload docs artifact
uses: actions/upload-artifact@v4
with:
name: docs-build
path: docs/_build

deploy-docs:
needs: [build-docs]
Expand All @@ -81,34 +80,34 @@ jobs:

name: Deploy docs
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v4

- name: Setup Pages
id: pages
uses: actions/configure-pages@v5
- name: Setup Pages
id: pages
uses: actions/configure-pages@v5

- name: Download docs artifact
uses: actions/download-artifact@v4
with:
name: docs-build
path: _site
- name: Download docs artifact
uses: actions/download-artifact@v4
with:
name: docs-build
path: _site

- name: Upload artifact
uses: actions/upload-pages-artifact@v3
- name: Upload artifact
uses: actions/upload-pages-artifact@v3

- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4

dist:
needs: [bump-version]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/checkout@v4
with:
fetch-depth: 0

- uses: hynek/build-and-inspect-python-package@v2
- uses: hynek/build-and-inspect-python-package@v2

publish:
needs: [dist]
Expand Down
Loading

0 comments on commit edb16a8

Please sign in to comment.