Skip to content

Commit

Permalink
Release version 0.1.0 (#40)
Browse files Browse the repository at this point in the history
Releases version 0.1.0 to main
  • Loading branch information
AntonReinhard authored Aug 9, 2024
2 parents 4971c86 + 5cddd55 commit b9a015c
Show file tree
Hide file tree
Showing 25 changed files with 1,069 additions and 180 deletions.
1 change: 1 addition & 0 deletions .JuliaFormatter.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
style = "blue"
2 changes: 2 additions & 0 deletions .formatting/Project.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[deps]
JuliaFormatter = "98e50ef6-434e-11e9-1051-2b60c6c9e899"
12 changes: 12 additions & 0 deletions .formatting/format_all.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
using JuliaFormatter

# we asume the format_all.jl script is located in QEDfields.jl/.formatting
project_path = Base.Filesystem.joinpath(Base.Filesystem.dirname(Base.source_path()), "..")

not_formatted = format(project_path; verbose=true)
if not_formatted
@info "Formatting verified."
else
@warn "Formatting verification failed: Some files are not properly formatted!"
end
exit(not_formatted ? 0 : 1)
32 changes: 32 additions & 0 deletions .github/workflows/BuildDeployDoc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Build and Deploy Documentation

on:
push:
branches:
- master
- dev
tags: "*"
pull_request:

jobs:
build:
permissions:
contents: write
statuses: write
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: julia-actions/setup-julia@v1
with:
version: "1.10"
- name: Add custom registry
run: |
julia --project=docs/ -e 'import Pkg; Pkg.Registry.add(Pkg.RegistrySpec(url="https://github.com/QEDjl-project/registry.git"));'
julia --project=docs/ -e 'import Pkg; Pkg.Registry.add(Pkg.RegistrySpec(url="https://github.com/JuliaRegistries/General"));'
- name: Install dependencies
run: |
julia --project=docs/ -e 'using Pkg; Pkg.develop(PackageSpec(path=pwd())); Pkg.instantiate()'
- name: Build and deploy
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # If authenticating with GitHub Actions token
run: julia --project=docs/ docs/make.jl
46 changes: 41 additions & 5 deletions .github/workflows/CompatHelper.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,50 @@ on:
schedule:
- cron: 0 0 * * *
workflow_dispatch:
permissions:
contents: write
pull-requests: write
jobs:
CompatHelper:
if: github.repository == 'QEDjl-project/QEDfields.jl'
runs-on: ubuntu-latest
steps:
- name: Pkg.add("CompatHelper")
run: julia -e 'using Pkg; Pkg.add("CompatHelper")'
- name: CompatHelper.main()
- name: Check if Julia is already available in the PATH
id: julia_in_path
run: which julia
continue-on-error: true
- name: Install Julia, but only if it is not already available in the PATH
uses: julia-actions/setup-julia@v1
with:
version: '1'
arch: ${{ runner.arch }}
if: steps.julia_in_path.outcome != 'success'
- name: "Add the General registry via Git"
run: |
import Pkg
ENV["JULIA_PKG_SERVER"] = ""
Pkg.Registry.add("General")
shell: julia --color=yes {0}
- name: "Add QED custom registry"
run: |
import Pkg
ENV["JULIA_PKG_SERVER"] = ""
Pkg.Registry.add(Pkg.RegistrySpec(url="https://github.com/QEDjl-project/registry.git"))
shell: julia --color=yes {0}
- name: "Install CompatHelper"
run: |
import Pkg
name = "CompatHelper"
uuid = "aa819f21-2bde-4658-8897-bab36330d9b7"
version = "3"
Pkg.add(; name, uuid, version)
shell: julia --color=yes {0}
- name: "Run CompatHelper"
run: |
import CompatHelper
CompatHelper.main(; master_branch="dev")
shell: julia --color=yes {0}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
COMPATHELPER_PRIV: ${{ secrets.DOCUMENTER_KEY }}
run: julia -e 'using CompatHelper; CompatHelper.main()'
# COMPATHELPER_PRIV: ${{ secrets.DOCUMENTER_KEY }}
COMPATHELPER_PRIV: ${{ secrets.COMPATHELPER_PRIV }}
16 changes: 16 additions & 0 deletions .github/workflows/formatter.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: formatter
on: [pull_request]
jobs:
formatter:
runs-on: ubuntu-latest
steps:
- name: checkout repo
uses: actions/checkout@v4
- name: install Julia
uses: julia-actions/setup-julia@v1
with:
version: 1.10
- name: Install Julia requirements
run: julia --project=${GITHUB_WORKSPACE}/.formatting -e 'import Pkg; Pkg.instantiate()'
- name: Check code style
run: julia --project=${GITHUB_WORKSPACE}/.formatting ${GITHUB_WORKSPACE}/.formatting/format_all.jl
8 changes: 7 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,7 @@
/docs/build/
docs/build/

# File generated by Pkg, the package manager, based on a corresponding Project.toml
# It records a fixed state of all packages used by the project. As such, it should not be
# committed for packages, but should be committed for applications that require a static
# environment.
Manifest.toml
120 changes: 120 additions & 0 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,120 @@
stages:
- unit-test
- generate_integration_test
- run_integration_test
- verify-unit-test-deps

.untit_test_template:
stage: unit-test
script:
- apt update && apt install -y git
- git clone --depth 1 -b dev https://github.com/QEDjl-project/QED.jl.git /QEDjl
- julia --project=. -e 'import Pkg; Pkg.Registry.add(Pkg.RegistrySpec(url="https://github.com/QEDjl-project/registry.git"));'
- julia --project=. -e 'import Pkg; Pkg.Registry.add(Pkg.RegistrySpec(url="https://github.com/JuliaRegistries/General"));'
- >
if [[ $CI_COMMIT_BRANCH == "main" || $CI_COMMIT_REF_NAME == "main" || $CI_COMMIT_BRANCH == "dev" || $CI_COMMIT_REF_NAME == "dev" ]]; then
# set name of the commit message from CI_COMMIT_MESSAGE to NO_MESSAGE, that the script does not read accidentally custom packages from the commit message of a merge commit
julia --project=. /QEDjl/.ci/SetupDevEnv/src/SetupDevEnv.jl ${CI_PROJECT_DIR}/Project.toml NO_MESSAGE
else
julia --project=. /QEDjl/.ci/SetupDevEnv/src/SetupDevEnv.jl ${CI_PROJECT_DIR}/Project.toml
fi
- julia --project=. -e 'import Pkg; Pkg.instantiate()'
- julia --project=. -e 'import Pkg; Pkg.test(; coverage = true)'
interruptible: true
tags:
- cpuonly

unit_tests_releases:
extends: .untit_test_template
parallel:
matrix:
- JULIA_VERSION: ["1.6", "1.7", "1.8", "1.9", "1.10", "rc"]
image: julia:$JULIA_VERSION

unit_tests_nightly:
extends: .untit_test_template
# use the same baseimage like the official julia images
image: debian:bookworm-slim
variables:
# path where julia tar bal should be downloaded
JULIA_DONWLOAD: /julia/download
# path where julia should be extracted
JULIA_EXTRACT: /julia/extract
before_script:
- apt update && apt install -y wget
- mkdir -p $JULIA_DONWLOAD
- mkdir -p $JULIA_EXTRACT
- >
if [[ $CI_RUNNER_EXECUTABLE_ARCH == "linux/arm64" ]]; then
wget https://julialangnightlies-s3.julialang.org/bin/linux/aarch64/julia-latest-linux-aarch64.tar.gz -O $JULIA_DONWLOAD/julia-nightly.tar.gz
elif [[ $CI_RUNNER_EXECUTABLE_ARCH == "linux/amd64" ]]; then
wget https://julialangnightlies-s3.julialang.org/bin/linux/x86_64/julia-latest-linux-x86_64.tar.gz -O $JULIA_DONWLOAD/julia-nightly.tar.gz
else
echo "unknown runner architecture -> $CI_RUNNER_EXECUTABLE_ARCH"
exit 1
fi
- tar -xf $JULIA_DONWLOAD/julia-nightly.tar.gz -C $JULIA_EXTRACT
# we need to search for the julia base folder name, because the second part of the name is the git commit hash
# e.g. julia-b0c6781676f
- JULIA_EXTRACT_FOLDER=${JULIA_EXTRACT}/$(ls $JULIA_EXTRACT | grep -m1 julia)
# copy everything to /usr to make julia public available
# mv is not possible, because it cannot merge folder
- cp -r $JULIA_EXTRACT_FOLDER/* /usr
allow_failure: true

generate_integration_tests:
image: julia:1.10
stage: generate_integration_test
script:
# extract package name
- export CI_DEPENDENCY_NAME=$(cat $CI_PROJECT_DIR/Project.toml | grep name | awk '{ print $3 }' | tr -d '"')
- echo "CI_DEPENDENCY_NAME -> $CI_DEPENDENCY_NAME"
- apt update && apt install -y git
- git clone --depth 1 -b dev https://github.com/QEDjl-project/QED.jl.git /QEDjl
- cd /QEDjl/.ci/integTestGen/
# use local registry of the QED project
- julia --project=. -e 'import Pkg; Pkg.Registry.add(Pkg.RegistrySpec(url="https://github.com/QEDjl-project/registry.git"));'
# needs to add General registry again, if local registry was added
- julia --project=. -e 'import Pkg; Pkg.Registry.add(Pkg.RegistrySpec(url="https://github.com/JuliaRegistries/General"));'
- julia --project=. -e 'import Pkg; Pkg.instantiate()'
# paths of artifacts are relative to CI_PROJECT_DIR
- >
if [[ $CI_COMMIT_BRANCH == "main" || $CI_COMMIT_REF_NAME == "main" || $CI_COMMIT_BRANCH == "dev" || $CI_COMMIT_REF_NAME == "dev" ]]; then
# set name of the commit message from CI_COMMIT_MESSAGE to NO_MESSAGE, that the script does not read accidentally custom packages from the commit message of a merge commit
julia --project=. src/integTestGen.jl NO_MESSAGE > $CI_PROJECT_DIR/integrationjobs.yaml
else
julia --project=. src/integTestGen.jl > $CI_PROJECT_DIR/integrationjobs.yaml
fi
- cat $CI_PROJECT_DIR/integrationjobs.yaml
artifacts:
paths:
- integrationjobs.yaml
expire_in: 1 week
interruptible: true
tags:
- cpuonly

run_integration_tests:
stage: run_integration_test
trigger:
include:
- artifact: integrationjobs.yaml
job: generate_integration_tests
strategy: depend

verify-unit-test-deps_julia1.10:
image: julia:1.10
stage: verify-unit-test-deps
script:
- apt update && apt install -y git
- git clone --depth 1 -b dev https://github.com/QEDjl-project/QED.jl.git /QEDjl
- >
if [[ $CI_COMMIT_BRANCH == "main" || $CI_COMMIT_REF_NAME == "main" || $CI_COMMIT_BRANCH == "dev" || $CI_COMMIT_REF_NAME == "dev" ]]; then
# does not check for custom package URLs on the main and dev branch
echo "no custom package URL check necessary"
else
julia /QEDjl/.ci/verify_env.jl
fi
interruptible: true
tags:
- cpuonly
29 changes: 29 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# Changelog

## Version 0.1.0

**Initial Release**

### New features

- [#14](https://github.com/QEDjl-project/QEDfields.jl/pull/14): Add interface for pulsed plane-wave fields (`AbstractBackgroundField`)
- [#24](https://github.com/QEDjl-project/QEDfields.jl/pull/24): Add Cos Square Pulse background field implementation

### Maintenance

- [#3](https://github.com/QEDjl-project/QEDfields.jl/pull/3): Add unit testing
- [#5](https://github.com/QEDjl-project/QEDfields.jl/pull/5): Add integration tests
- [#8](https://github.com/QEDjl-project/QEDfields.jl/pull/8): Add install instructions
- [#11](https://github.com/QEDjl-project/QEDfields.jl/pull/11): Add JuliaFormatter
- [#12](https://github.com/QEDjl-project/QEDfields.jl/pull/12): Remove Manifest.toml
- [#13](https://github.com/QEDjl-project/QEDfields.jl/pull/13): Move CI formatting job to github actions
- [#15](https://github.com/QEDjl-project/QEDfields.jl/pull/15): Add documentation build and deploy jobs to CI
- [#17](https://github.com/QEDjl-project/QEDfields.jl/pull/17): Run unit tests with additional Julia versions
- [#18](https://github.com/QEDjl-project/QEDfields.jl/pull/18): Fix compat helper
- [#19](https://github.com/QEDjl-project/QEDfields.jl/pull/19): Run compat helper only on upstream repository
- [#26](https://github.com/QEDjl-project/QEDfields.jl/pull/26): Refactor cos square pulse implementation
- [#29](https://github.com/QEDjl-project/QEDfields.jl/pull/29): QED.jl refactoring
- [#30](https://github.com/QEDjl-project/QEDfields.jl/pull/30): Use QEDcore.jl implementations over QEDbase
- [#34](https://github.com/QEDjl-project/QEDfields.jl/pull/34): Refactoring cleanup
- [#36](https://github.com/QEDjl-project/QEDfields.jl/pull/36): Add Julia 1.10 and rc to CI testing versions
- [#39](https://github.com/QEDjl-project/QEDfields.jl/pull/39): Cleanup work for 0.1.0 release
2 changes: 0 additions & 2 deletions Manifest.toml

This file was deleted.

29 changes: 27 additions & 2 deletions Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,32 @@
name = "QEDfields"
uuid = "ac3a6c97-e859-4b9f-96bb-63d2a216042c"
authors = ["Uwe Hernandez Acosta <[email protected]>", "Simeon Ehrig", "Klaus Steiniger", "Tom Jungnickel", "Anton Reinhard"]
authors = [
"Uwe Hernandez Acosta <[email protected]>",
"Simeon Ehrig",
"Klaus Steiniger",
"Tom Jungnickel",
"Anton Reinhard",
]
version = "0.1.0"

[deps]
IntervalSets = "8197267c-284f-5f27-9208-e0e47529a953"
QEDbase = "10e22c08-3ccb-4172-bfcf-7d7aa3d04d93"
QEDcore = "35dc0263-cb5f-4c33-a114-1d7f54ab753e"
QuadGK = "1fd47b50-473d-5c70-9696-f719f8f3bcdc"

[compat]
julia = "1.9"
QEDbase = "0.2.2"
QEDcore = "0.1"
IntervalSets = "0.7"
QuadGK = "2"
julia = "1.6"

[extras]
Pkg = "44cfe95a-1eb2-52ea-b672-e2afdf69b78f"
Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"
SafeTestsets = "1bc83da4-3b8d-516f-aca4-4fe02f6d838f"
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"

[targets]
test = ["Pkg", "Random", "SafeTestsets", "Test"]
36 changes: 36 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,39 @@
# QEDfields

[![Doc Stable](https://img.shields.io/badge/docs-stable-blue.svg)](https://qedjl-project.github.io/QEDfields.jl/main)
[![Doc Dev](https://img.shields.io/badge/docs-dev-blue.svg)](https://qedjl-project.github.io/QEDfields.jl/dev)
[![Code Style: Blue](https://img.shields.io/badge/code%20style-blue-4495d1.svg)](https://github.com/invenia/BlueStyle)

## Installation

To install the current stable version of `QEDfields.jl` you may use the standard julia package manager within the julia REPL

```julia
julia> using Pkg
julia> Pkg.add("QEDfields")
```

or you use the Pkg prompt by hitting `]` within the Julia REPL and then type

```julia
(@v1.10) pkg> add QEDfields
```

To install the locally downloaded package on Windows, change to the parent directory and type within the Pkg prompt

```julia
(@v1.10) pkg> add ./QEDfields.jl
```

# Development

## Formatting

We use [JuliaFormatter.jl](https://domluna.github.io/JuliaFormatter.jl/dev/) and the [Blue style](https://github.com/invenia/BlueStyle) to format our code. The correct form of the code is checked by a CI job. To format the code manually, run the following commands:

```bash
# install dependencies
julia --project=.formatting -e 'import Pkg; Pkg.instantiate()'
# format all documents
julia --project=.formatting .formatting/format_all.jl
```
Loading

0 comments on commit b9a015c

Please sign in to comment.