Skip to content

Commit

Permalink
Move largest chunk of CI to github actions
Browse files Browse the repository at this point in the history
  • Loading branch information
mfherbst committed Nov 17, 2020
1 parent 9320503 commit deb71a9
Show file tree
Hide file tree
Showing 8 changed files with 157 additions and 68 deletions.
139 changes: 139 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,139 @@
name: CI
on:
push:
branches:
- master
- /^v\d+\.\d+(\.\d+)?(-\S*)?$/ # Tags
- staging # Bors
- trying # Bors
pull_request:
branches:
- master
schedule:
- cron: '* * * * 6' # Run every Sunday

jobs:
#
# Unit tests
#
test:
name: Julia ${{ matrix.version }} - ${{ matrix.os }} - ${{ matrix.payload }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- {version: '1.4', os: ubuntu-latest, payload: serial}
- {version: '1.4', os: macOS-latest, payload: serial}
# - {version: '1.4', os: windows-latest, payload: serial}
- {version: '1.4', os: ubuntu-latest, payload: mpi }
- {version: nightly, os: ubuntu-latest, payload: serial}
env:
PYTHON: "" # Force using Conda in PyCall
steps:
- uses: actions/checkout@v2
- uses: julia-actions/setup-julia@v1
with:
version: ${{ matrix.version }}
arch: x64
- uses: actions/cache@v1
env:
cache-name: cache-artifacts
with:
path: ~/.julia/artifacts
key: ${{ runner.os }}-test-${{ env.cache-name }}-${{ hashFiles('**/Project.toml') }}
restore-keys: |
${{ runner.os }}-test-${{ env.cache-name }}-
${{ runner.os }}-test-
${{ runner.os }}-
- name: Install Conda dependencies
shell: bash
run: |
julia -e '
using Pkg; Pkg.add("Conda"); using Conda
Conda.add(["libblas=*=*netlib", "nomkl", "ase", "pymatgen"]; channel="conda-forge")
'
- uses: julia-actions/julia-buildpkg@latest

- name: Execute serial tests
uses: julia-actions/julia-runtest@latest
if: ${{ matrix.payload == 'serial' }}

- name: Execute MPI-parallel tests
run: |
julia --project -e '
using Pkg; Pkg.build(); Pkg.precompile()
Pkg.add("MPI"); using MPI; MPI.install_mpiexecjl()
Pkg.test(; test_args=["quick"])
'
$HOME/.julia/bin/mpiexecjl -np 2 julia --check-bounds=yes --depwarn=yes --project --color=yes --compiled-modules=no -e 'using Pkg; Pkg.test(coverage=true)'
if: ${{ matrix.payload == 'mpi' }}

- uses: julia-actions/julia-processcoverage@v1
- uses: julia-actions/julia-uploadcoveralls@v1
env:
COVERALLS_TOKEN: ${{ secrets.COVERALLS_TOKEN }}
continue-on-error: true
#
# Examples
#
examples:
name: Run examples
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: '3.6'
- name: Install python dependencies
run: pip install ase pymatgen
- uses: julia-actions/setup-julia@v1
with:
version: '1.4'
- uses: actions/cache@v1
env:
cache-name: cache-artifacts
with:
path: ~/.julia/artifacts
key: ${{ runner.os }}-test-${{ env.cache-name }}-${{ hashFiles('**/Project.toml') }}
restore-keys: |
${{ runner.os }}-test-${{ env.cache-name }}-
${{ runner.os }}-test-
${{ runner.os }}-
- run: julia --color=yes --project -e 'using Pkg; Pkg.test(test_args = ["example"])'
#
# Docs
#
docs:
name: Documentation
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: '3.6'
- name: Install python dependencies
run: pip install ase pymatgen
- uses: julia-actions/setup-julia@v1
with:
version: '1'
- name: Instantiate and build packages
run: |
julia --project=docs -e '
using Pkg
Pkg.develop(PackageSpec(path=pwd()))
Pkg.instantiate()
Pkg.build("DFTK")
'
- name: Run doctests
run: |
julia --project=docs -e '
using Documenter: DocMeta, doctest
using DFTK
DocMeta.setdocmeta!(DFTK, :DocTestSetup, :(using DFTK); recursive=true)
doctest(DFTK)'
- name: Generate docs
run: julia --project=docs docs/make.jl
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
DOCUMENTER_KEY: ${{ secrets.DOCUMENTER_KEY }}
26 changes: 0 additions & 26 deletions .github/workflows/runexamples.yaml

This file was deleted.

33 changes: 1 addition & 32 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,39 +30,8 @@ after_success: | # Upload coverage when things are good.
Coveralls.submit(coverage)
'
os:
- linux
- osx
julia: "1.4"

jobs:
allow_failures: # Allow to fail on nightly
- julia: nightly
include:
- julia: nightly # Nightly test
os: linux
- os: linux # MPI test
script: # Install DFTK and MPI, precompile, install test packages
- julia -e '
using Pkg; Pkg.build(); Pkg.precompile();
using MPI; MPI.install_mpiexecjl();
Pkg.test(; test_args=["quick"])
'
- $HOME/.julia/bin/mpiexecjl -np $MPI_NUM_PROCS julia --compiled-modules=no -e 'using Pkg; Pkg.test(coverage=true)'
env: MPI_NUM_PROCS=2
- stage: "Documentation"
os: linux
script:
- *conda
- |
julia --project=docs/ -e '
using Pkg
Pkg.develop(PackageSpec(path=pwd()))
Pkg.instantiate()
Pkg.build("DFTK")
'
- julia --project=docs/ docs/make.jl
after_success: skip
os: linux

notifications:
email: false
Expand Down
17 changes: 10 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,21 @@

# Density-functional toolkit

| **Documentation** | **Build Status** | **License** |
|:------------------------------------------------------- |:------------------------------------------------------ |:-------------------------------- |
| [![][docs-img]][docs-url] [![][gitter-img]][gitter-url] | [![][travis-img]][travis-url] [![][cov-img]][cov-url] | [![][license-img]][license-url] |
| **Documentation** | **Build Status** | **License** |
|:----------------------------------------------------------------------------------- |:---------------------------------------------- |:-------------------------------- |
| [![][docs-img]][docs-url] [![][ddocs-img]][ddocs-url] [![][gitter-img]][gitter-url] | [![][ci-img]][ci-url] [![][cov-img]][cov-url] | [![][license-img]][license-url] |

[docs-img]: https://img.shields.io/badge/docs-dev-blue.svg
[docs-url]: https://juliamolsim.github.io/DFTK.jl/dev
[ddocs-img]: https://img.shields.io/badge/docs-dev-blue.svg
[ddocs-url]: https://docs.dftk.org/dev

[docs-img]: https://img.shields.io/badge/docs-stable-blue.svg
[docs-url]: https://docs.dftk.org/stable

[gitter-img]: https://badges.gitter.im/DFTK-jl/community.svg
[gitter-url]: https://gitter.im/DFTK-jl/community

[travis-img]: https://travis-ci.com/JuliaMolSim/DFTK.jl.svg?branch=master
[travis-url]: https://travis-ci.com/JuliaMolSim/DFTK.jl
[ci-img]: https://github.com/JuliaMolSim/DFTK.jl/workflows/CI/badge.svg?branch=master&event=push
[ci-url]: https://github.com/JuliaMolSim/DFTK.jl/actions

[cov-img]: https://coveralls.io/repos/JuliaMolSim/DFTK.jl/badge.svg?branch=master&service=github
[cov-url]: https://coveralls.io/github/JuliaMolSim/DFTK.jl?branch=master
Expand Down
2 changes: 1 addition & 1 deletion bors.toml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
status = ["continuous-integration/travis-ci/push", "Run DFTK examples"]
status = ["continuous-integration/travis-ci/push", "CI"]
delete_merged_branches = true
2 changes: 1 addition & 1 deletion docs/src/guide/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ which will install the latest DFTK release.
Alternatively (if you like to be fully up to date) install the master branch:
```julia
import Pkg
Pkg.add("DFTK#master")
Pkg.add(name="DFTK", rev="master")
```

## Python dependencies
Expand Down
2 changes: 1 addition & 1 deletion docs/src/guide/parallelization.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ depending on architecture, DFTK or Julia version.
The rough trends should, however, be similar.

```@raw html
<img src="scaling.png" width=750 />
<img src="../scaling.png" width=750 />
```

The MPI-based parallelization strategy clearly shows a superior scaling
Expand Down
4 changes: 4 additions & 0 deletions src/FourierTransforms.jl/ctfft.jl
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
using Primes

# COV_EXCL_START

# 1d Cooley-Tukey FFTs, using an FFTW-like (version 1) approach: automatic
# generation of fixed-size FFT kernels (with and without twiddle factors)
# which are combined to make arbitrary-size FFTs (plus generic base
Expand Down Expand Up @@ -598,3 +600,5 @@ function fft_factors(T::Type, n::Integer)
end
factors
end

# COV_EXCL_STOP

0 comments on commit deb71a9

Please sign in to comment.