Skip to content

Commit e9911e1

Browse files
authored
Merge pull request #74 from MiraGeoscience/GEOPY-2029
GEOPY-2029: Update Simpeg 0.21.2 to 0.23
2 parents 42d8534 + 865f1c5 commit e9911e1

304 files changed

Lines changed: 19176 additions & 23635 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.azure-pipelines/matrix.yml

Lines changed: 0 additions & 91 deletions
This file was deleted.

.ci/azure/codecov.yml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
jobs:
2+
- job:
3+
pool:
4+
vmImage: "ubuntu-latest"
5+
displayName: Upload to Codecov
6+
steps:
7+
# Checkout simpeg repo. Codecov needs the repo in the file system for
8+
# uploading coverage reports.
9+
- checkout: self
10+
displayName: "Checkout repository"
11+
12+
- task: DownloadPipelineArtifact@2
13+
inputs:
14+
patterns: "coverage-*/coverage-*.xml"
15+
displayName: "Download coverage artifacts"
16+
17+
- bash: ls -la $(Pipeline.Workspace)/coverage-*/coverage-*.xml
18+
displayName: "List downloaded coverage artifacts"
19+
20+
- bash: |
21+
cp $(Pipeline.Workspace)/coverage-*/coverage-*.xml .
22+
ls -la
23+
displayName: "Copy coverage files"
24+
25+
- bash: |
26+
curl -Os https://uploader.codecov.io/latest/linux/codecov
27+
chmod +x codecov
28+
displayName: "Install codecov cli"
29+
30+
- bash: |
31+
cc_file_args=()
32+
for report in coverage-*.xml; do
33+
cc_file_args+=( " --file " "$report" )
34+
done
35+
./codecov --verbose upload-process "$cc_file_args"
36+
displayName: "Upload coverage to codecov.io"

.ci/azure/deploy-dev-docs.sh

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
#!/usr/bin/env bash
2+
3+
# Push built docs to dev branch in simpeg-docs repository
4+
5+
set -ex #echo on and exit if any line fails
6+
7+
# ---------------------------
8+
# Push new docs to dev branch
9+
# ---------------------------
10+
# Capture hash of last commit in simpeg
11+
commit=$(git rev-parse --short HEAD)
12+
13+
# Clone the repo where we store the documentation (dev branch)
14+
git clone -q --branch dev --depth 1 "https://${GH_TOKEN}@github.com/simpeg/simpeg-docs.git"
15+
cd simpeg-docs
16+
17+
# Remove all files (but .git folder)
18+
find . -not -path "./.git/*" -not -path "./.git" -delete
19+
20+
# Copy the built docs to the root of the repo
21+
cp -r "$BUILD_SOURCESDIRECTORY"/docs/_build/html/. -t .
22+
23+
# Add new files
24+
git add .
25+
26+
# List files in working directory and show git status
27+
ls -la
28+
git status
29+
30+
# Commit the new docs. Amend to avoid having a very large history.
31+
message="Azure CI deploy dev from ${commit}"
32+
echo -e "\nAmending last commit:"
33+
git commit --amend --reset-author -m "$message"
34+
35+
# Make the push quiet just in case there is anything that could
36+
# leak sensitive information.
37+
echo -e "\nPushing changes to simpeg/simpeg-docs (dev branch)."
38+
git push -fq origin dev 2>&1 >/dev/null
39+
echo -e "\nFinished uploading doc files."
40+
41+
# ----------------
42+
# Update submodule
43+
# ----------------
44+
# Need to fetch the gh-pages branch first (because we clone with shallow depth)
45+
git fetch --depth 1 origin gh-pages:gh-pages
46+
47+
# Switch to the gh-pages branch
48+
git switch gh-pages
49+
50+
# Update the dev submodule
51+
git submodule update --init --recursive --remote dev
52+
53+
# Add updated submodule
54+
git add dev
55+
56+
# List files in working directory and show git status
57+
ls -la
58+
git status
59+
60+
# Commit changes
61+
message="Azure CI update dev submodule from ${commit}"
62+
echo -e "\nMaking a new commit:"
63+
git commit -m "$message"
64+
65+
# Make the push quiet just in case there is anything that could
66+
# leak sensitive information.
67+
echo -e "\nPushing changes to simpeg/simpeg-docs (gh-pages branch)."
68+
git push -q origin gh-pages 2>&1 >/dev/null
69+
echo -e "\nFinished updating submodule dev."

.ci/azure/deploy-release-docs.sh

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
#!/usr/bin/env bash
2+
3+
# Push built docs to gh-pages branch in simpeg-docs repository
4+
5+
set -ex #echo on and exit if any line fails
6+
7+
# Capture simpeg version
8+
version=$(git tag --points-at HEAD)
9+
if [[ -z $version ]]; then
10+
echo "Version could not be obtained from tag. Exiting."
11+
exit 1
12+
fi
13+
14+
# Capture hash of last commit in simpeg
15+
commit=$(git rev-parse --short HEAD)
16+
17+
# Clone the repo where we store the documentation
18+
git clone -q --branch gh-pages --depth 1 "https://${GH_TOKEN}@github.com/simpeg/simpeg-docs.git"
19+
cd simpeg-docs
20+
21+
# Move the built docs to a new dev folder
22+
cp -r "$BUILD_SOURCESDIRECTORY/docs/_build/html" "$version"
23+
cp "$BUILD_SOURCESDIRECTORY/docs/README.md" .
24+
25+
# Add .nojekyll if missing
26+
touch .nojekyll
27+
28+
# Update latest symlink
29+
rm -f latest
30+
ln -s "$version" latest
31+
32+
# Add new docs and relevant files
33+
git add "$version" README.md .nojekyll latest
34+
35+
# List files in working directory and show git status
36+
ls -la
37+
git status
38+
39+
# Commit the new docs.
40+
message="Azure CI deploy ${version} from ${commit}"
41+
echo -e "\nMaking a new commit:"
42+
git commit -m "$message"
43+
44+
# Make the push quiet just in case there is anything that could
45+
# leak sensitive information.
46+
echo -e "\nPushing changes to simpeg/simpeg-docs."
47+
git push -fq origin gh-pages 2>&1 >/dev/null
48+
echo -e "\nFinished uploading generated files."

.ci/azure/docs.yml

Lines changed: 112 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,112 @@
1+
jobs:
2+
# Build docs only on scheduled jobs or on a relase
3+
- job: BuildDocs
4+
condition: or(eq(variables['Build.Reason'], 'Schedule'), startsWith(variables['build.sourceBranch'], 'refs/tags/'))
5+
pool:
6+
vmImage: ubuntu-latest
7+
variables:
8+
python.version: "3.10"
9+
timeoutInMinutes: 240
10+
steps:
11+
# Checkout simpeg repo.
12+
# Sync tags and disable shallow depth to get the SimPEG version.
13+
- checkout: self
14+
fetchDepth: 0
15+
fetchTags: true
16+
displayName: Checkout repository (including tags)
17+
18+
- bash: echo "##vso[task.prependpath]$CONDA/bin"
19+
displayName: Add conda to PATH
20+
21+
- bash: .ci/azure/setup_env.sh
22+
displayName: Setup SimPEG environment
23+
24+
- bash: |
25+
source activate simpeg-test
26+
make -C docs html
27+
displayName: Building documentation
28+
29+
- task: PublishPipelineArtifact@1
30+
inputs:
31+
targetPath: $(Build.SourcesDirectory)/docs/_build/html
32+
artifactName: built-docs
33+
displayName: "Upload docs as artifact"
34+
35+
- job: DeployRelease
36+
dependsOn: BuildDocs
37+
condition: startsWith(variables['build.sourceBranch'], 'refs/tags/')
38+
pool:
39+
vmImage: ubuntu-latest
40+
timeoutInMinutes: 240
41+
steps:
42+
# Checkout simpeg repo.
43+
# Sync tags and disable shallow depth to get the SimPEG version.
44+
- checkout: self
45+
fetchDepth: 0
46+
fetchTags: true
47+
displayName: Checkout repository (including tags)
48+
49+
- bash: |
50+
git config --global user.name ${GH_NAME}
51+
git config --global user.email ${GH_EMAIL}
52+
git config --list | grep user.
53+
displayName: "Configure git"
54+
env:
55+
GH_NAME: $(gh.name)
56+
GH_EMAIL: $(gh.email)
57+
58+
- bash: |
59+
mkdir -p docs/_build/html
60+
displayName: "Create directory for built docs"
61+
62+
- task: DownloadPipelineArtifact@2
63+
inputs:
64+
artifact: built-docs
65+
targetPath: docs/_build/html
66+
displayName: "Download docs artifact"
67+
68+
# Upload release build of the docs to gh-pages branch in simpeg/simpeg-docs
69+
- bash: .ci/azure/deploy-release-docs.sh
70+
displayName: Push documentation to simpeg-docs
71+
env:
72+
GH_TOKEN: $(gh.token)
73+
74+
- job: DeployDev
75+
dependsOn: BuildDocs
76+
condition: eq(variables['Build.Reason'], 'Schedule') # run only scheduled triggers
77+
pool:
78+
vmImage: ubuntu-latest
79+
timeoutInMinutes: 240
80+
steps:
81+
# Checkout simpeg repo.
82+
# Sync tags and disable shallow depth to get the SimPEG version.
83+
- checkout: self
84+
fetchDepth: 0
85+
fetchTags: true
86+
displayName: Checkout repository (including tags)
87+
88+
- bash: |
89+
git config --global user.name ${GH_NAME}
90+
git config --global user.email ${GH_EMAIL}
91+
git config --list | grep user.
92+
displayName: "Configure git"
93+
env:
94+
GH_NAME: $(gh.name)
95+
GH_EMAIL: $(gh.email)
96+
97+
- bash: |
98+
mkdir -p docs/_build/html
99+
displayName: "Create directory for built docs"
100+
101+
- task: DownloadPipelineArtifact@2
102+
inputs:
103+
artifact: built-docs
104+
targetPath: docs/_build/html
105+
displayName: "Download docs artifact"
106+
107+
# Upload dev build of the docs to a dev branch in simpeg/simpeg-docs
108+
# and update submodule in the gh-pages branch
109+
- bash: .ci/azure/deploy-dev-docs.sh
110+
displayName: Push documentation to simpeg-docs (dev branch)
111+
env:
112+
GH_TOKEN: $(gh.token)

0 commit comments

Comments
 (0)