Skip to content

Commit

Permalink
Apply same changes as QEDbase for new CI (#75)
Browse files Browse the repository at this point in the history
  • Loading branch information
AntonReinhard authored Oct 24, 2024
1 parent ea741b3 commit 16b1951
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 13 deletions.
19 changes: 11 additions & 8 deletions .github/workflows/BuildDeployDoc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,19 @@ jobs:
- uses: actions/checkout@v4
- uses: julia-actions/setup-julia@v1
with:
version: "1.10"
- name: Install dependencies
version: '1.10'
- name: clone integration test tools
run: |
julia --project=docs/ -e 'using Pkg; Pkg.develop(PackageSpec(path=pwd())); Pkg.instantiate()'
- name: set dependencies to dev branch version
if: (github.event_name == 'push' && github.ref_name != 'main') || (github.event_name == 'pull_request' && github.base_ref != 'main')
git clone --depth 1 -b dev https://github.com/QEDjl-project/QuantumElectrodynamics.jl.git /tmp/integration_test_tools/
- name: set dev dependencies
run: |
git clone -b dev https://github.com/QEDjl-project/QuantumElectrodynamics.jl.git /tmp/integration_test_tools
julia --project=docs/ /tmp/integration_test_tools/.ci/set_dev_dependencies.jl
$(julia --project=. /tmp/integration_test_tools/.ci/integTestGen/src/get_project_name_version_path.jl)
echo "CI_DEV_PKG_NAME -> $CI_DEV_PKG_NAME"
echo "CI_DEV_PKG_VERSION -> $CI_DEV_PKG_VERSION"
echo "CI_DEV_PKG_PATH -> $CI_DEV_PKG_PATH"
julia --project=docs/ /tmp/integration_test_tools/.ci/SetupDevEnv/src/SetupDevEnv.jl
julia --project=docs/ -e 'import Pkg; Pkg.instantiate()'
- name: Build and deploy
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # If authenticating with GitHub Actions token
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: julia --project=docs/ docs/make.jl
18 changes: 13 additions & 5 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,17 @@ stages:
stage: unit-test
script:
- apt update && apt install -y git
- git clone --depth 1 -b dev https://github.com/QEDjl-project/QuantumElectrodynamics.jl.git /QEDjl
- git clone --depth 1 -b dev https://github.com/QEDjl-project/QuantumElectrodynamics.jl.git /tmp/integration_test_tools/
- $(julia --project=. /tmp/integration_test_tools/.ci/integTestGen/src/get_project_name_version_path.jl)
- echo "CI_DEV_PKG_NAME -> $CI_DEV_PKG_NAME"
- echo "CI_DEV_PKG_VERSION -> $CI_DEV_PKG_VERSION"
- echo "CI_DEV_PKG_PATH -> $CI_DEV_PKG_PATH"
- >
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
julia --project=. /tmp/integration_test_tools/.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
julia --project=. /tmp/integration_test_tools/.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)'
Expand Down Expand Up @@ -62,15 +66,19 @@ unit_tests_nightly:
tags:
- cpuonly

generate_integration_tests:
image: julia:1.10
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/QuantumElectrodynamics.jl.git /QEDjl
- $(julia --project /QEDjl/.ci/integTestGen/src/get_project_name_version_path.jl)
- echo "CI_DEV_PKG_NAME -> $CI_DEV_PKG_NAME"
- echo "CI_DEV_PKG_VERSION -> $CI_DEV_PKG_VERSION"
- echo "CI_DEV_PKG_PATH -> $CI_DEV_PKG_PATH"
- cd /QEDjl/.ci/integTestGen/
- julia --project=. -e 'import Pkg; Pkg.instantiate()'
# paths of artifacts are relative to CI_PROJECT_DIR
Expand Down

0 comments on commit 16b1951

Please sign in to comment.