Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
93 commits
Select commit Hold shift + click to select a range
3f13773
[DOC] Move documentation builder to actions.
alfaro96 Sep 24, 2021
7d0deb2
[FIX] Fix path to documentation builder script.
alfaro96 Sep 24, 2021
cade5f7
[FIX] Fix pip install sentence.
alfaro96 Sep 24, 2021
f7f288b
[FIX] Fix dependency versions.
alfaro96 Sep 24, 2021
9057564
[FIX] Fix action syntax.
alfaro96 Sep 24, 2021
e5887b0
[CI] Add push step.
alfaro96 Sep 24, 2021
1899ea9
[FIX] Add new step.
alfaro96 Sep 24, 2021
1c0546c
[FIX] Fix path to shell script.
alfaro96 Sep 24, 2021
a79cd1e
[FIX] Fix commit SHA.
alfaro96 Sep 24, 2021
0279c08
[FIX] Fix repository to fetch.
alfaro96 Sep 24, 2021
21fbec0
[FIX] Fix ref to fetch.
alfaro96 Sep 24, 2021
6e21020
[DBG] Debugging paths.
alfaro96 Sep 24, 2021
690fee6
[DBG] Debugging paths.
alfaro96 Sep 24, 2021
977bbeb
[DBG] Debugging paths.
alfaro96 Sep 24, 2021
8fb6600
[FIX] Fix path.
alfaro96 Sep 24, 2021
9d39ea4
[FIX] Fix action.
alfaro96 Sep 24, 2021
f5c6c63
[FIX] Fix paths.
alfaro96 Sep 24, 2021
5efa805
[FIX] Fix paths.
alfaro96 Sep 24, 2021
aa84276
[FIX] Fix condition.
alfaro96 Sep 24, 2021
1cb3944
[DBG] Debugging paths.
alfaro96 Sep 24, 2021
919788c
[DBG] Debugging paths.
alfaro96 Sep 24, 2021
16e5204
[DBG] Debugging.
alfaro96 Sep 24, 2021
739e22d
[DBG] Debugging.
alfaro96 Sep 24, 2021
c211283
[DBG] Debugging.
alfaro96 Sep 24, 2021
dee2848
Merge branch 'main' into move_doc_builder
alfaro96 Apr 27, 2022
6c1d5b4
[CI] Monkey-patch build_doc.sh to work with both documentation builders
alfaro96 Apr 27, 2022
905b9e0
[FIX] Fix syntax
alfaro96 Apr 27, 2022
015af42
[FIX] Fix syntax
alfaro96 Apr 27, 2022
a006f95
[FIX] Fix syntax
alfaro96 Apr 27, 2022
4bd04ab
[FIX] Fix syntax
alfaro96 Apr 27, 2022
65e01be
[FIX] Checkout correct commit
alfaro96 Apr 27, 2022
b240998
[FIX] Checkout correct commit
alfaro96 Apr 27, 2022
20e56b2
[FIX] Checkout correct commit
alfaro96 Apr 27, 2022
919e611
[CLN] Remove pull request trigger
alfaro96 Apr 27, 2022
4615685
[FEA] Add doc-min-dependencies job
alfaro96 Apr 28, 2022
5463071
[CLN] Remove pull request trigger
alfaro96 Apr 28, 2022
16d57ed
[FEA] First attempt to trigger using actions
alfaro96 Apr 28, 2022
466d00b
[FIX] Fix syntax and variables
alfaro96 Apr 28, 2022
990c304
[FIX] Fix syntax and variables
alfaro96 Apr 28, 2022
a854c3d
[FIX] Fix syntax and variables
alfaro96 Apr 28, 2022
d3c4bf6
[FIX] Fix syntax and variables
alfaro96 Apr 28, 2022
97d5370
[FIX] Fix syntax and variables
alfaro96 Apr 28, 2022
15d9746
Just for testing
alfaro96 Apr 28, 2022
dd7308e
Trigger build
alfaro96 Apr 28, 2022
07533ba
Trigger build
alfaro96 Apr 28, 2022
c08e4ef
More testing
alfaro96 Apr 28, 2022
65f0644
More testing
alfaro96 Apr 28, 2022
fe0a46e
More testing
alfaro96 Apr 28, 2022
2e59ae9
[FIX] Fix parameter name
alfaro96 Apr 28, 2022
5825d19
Trigger build
alfaro96 Apr 28, 2022
1ee28de
Trigger build
alfaro96 Apr 28, 2022
d45506b
[FIX] Fix run in push-docs
alfaro96 Apr 28, 2022
211f69f
Trigger build
alfaro96 Apr 28, 2022
7dd50c8
[FIX] Fix run in push-docs
alfaro96 Apr 28, 2022
a301800
Trigger build
alfaro96 Apr 28, 2022
e40b547
Trigger build
alfaro96 Apr 28, 2022
14076f5
Trigger build
alfaro96 Apr 28, 2022
8b70d03
[FIX] Fix environment variables
alfaro96 Apr 29, 2022
dce3df6
Trigger build
alfaro96 Apr 29, 2022
380676a
[FIX] Fix download script
alfaro96 Apr 29, 2022
101b3c3
[FIX] Fix run step
alfaro96 Apr 29, 2022
b0974a4
Trigger build
alfaro96 Apr 29, 2022
5d1e91f
[FIX] Fix environment variables
alfaro96 Apr 29, 2022
fe8b587
Trigger build
alfaro96 Apr 29, 2022
fca68a0
[FIX] Fix path to built documentation
alfaro96 Apr 29, 2022
69f0a42
Trigger build
alfaro96 Apr 29, 2022
b933f72
[FIX] Create path before extracting
alfaro96 Apr 29, 2022
7099f23
[MNT] Tryo to trigger to the proper branch
alfaro96 Apr 29, 2022
d0ccf90
Trigger build
alfaro96 Apr 29, 2022
fed17c9
[FIX] Fix yaml
alfaro96 Apr 29, 2022
686e461
[FIX] Fix yaml
alfaro96 Apr 29, 2022
37f2cf1
Trigger build
alfaro96 Apr 29, 2022
167a950
[MNT] Set execution permissions
alfaro96 Apr 29, 2022
7c940a2
Trigger build
alfaro96 Apr 29, 2022
70a6ae9
[FIX] Remove whitespaces
alfaro96 Apr 29, 2022
b391bfa
[FIX] Fix trailing quotes
alfaro96 Apr 29, 2022
0f1d39a
[Fix] Fix run step in jobs
alfaro96 Apr 29, 2022
913a071
[Fix] Fix permissions
alfaro96 Apr 29, 2022
b016b07
[MNT] Replace merge by head
alfaro96 Apr 29, 2022
697f32f
[DBG] Debug github event object
alfaro96 Apr 29, 2022
5dc9779
Trigger build [doc quick]
alfaro96 Apr 29, 2022
a4fbbe0
[DBG] Debug github event object
alfaro96 Apr 29, 2022
a735c83
Trigger build [doc quick]
alfaro96 Apr 29, 2022
7e725b6
Trigger build [doc quick]
alfaro96 May 1, 2022
63cf943
[MNT] Simplify trigger hosting
alfaro96 May 2, 2022
94457f6
Trigger build [doc quick]
alfaro96 May 2, 2022
1dd57c3
[FIX] Fix double execution of jobs
alfaro96 May 2, 2022
5e5699e
Trigger build [doc quick]
alfaro96 May 2, 2022
a166f97
[FIX] Fix merge conflicts and apply suggested changes
alfaro96 May 31, 2022
13fe978
[MNT] Remove unnecesary environment variables
alfaro96 May 31, 2022
f8a0fa1
Trigger build [doc quick]
alfaro96 May 31, 2022
0929e74
[MNT] Use CIRCLE_CI_TOKEN for the environment variable
alfaro96 May 31, 2022
6853582
Merge branch 'main' into move_doc_builder
thomasjpfan Jun 1, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
95 changes: 25 additions & 70 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,92 +1,42 @@
version: 2.1

# Parameters required to trigger the execution
# of the "doc-min-dependencies" and "doc" jobs
parameters:
GITHUB_RUN_URL:
type: string
default: "none"

jobs:
doc-min-dependencies:
docker:
- image: cimg/python:3.8.12
environment:
- OMP_NUM_THREADS: 2
- MKL_NUM_THREADS: 2
- CONDA_ENV_NAME: testenv
- LOCK_FILE: build_tools/circle/doc_min_dependencies_linux-64_conda.lock
- GITHUB_ARTIFACT_URL: << pipeline.parameters.GITHUB_RUN_URL >>/doc-min-dependencies.zip
steps:
- checkout
- run: ./build_tools/circle/checkout_merge_commit.sh
- restore_cache:
key: v1-doc-min-deps-datasets-{{ .Branch }}
- restore_cache:
keys:
- doc-min-deps-ccache-{{ .Branch }}
- doc-min-deps-ccache
- run: ./build_tools/circle/build_doc.sh
- save_cache:
key: doc-min-deps-ccache-{{ .Branch }}-{{ .BuildNum }}
paths:
- ~/.ccache
- ~/.cache/pip
- save_cache:
key: v1-doc-min-deps-datasets-{{ .Branch }}
paths:
- ~/scikit_learn_data
- run: bash build_tools/circle/download_documentation.sh
- store_artifacts:
path: doc/_build/html/stable
destination: doc
- store_artifacts:
path: ~/log.txt
destination: log.txt

doc:
docker:
- image: cimg/python:3.8.12
environment:
- OMP_NUM_THREADS: 2
- MKL_NUM_THREADS: 2
- CONDA_ENV_NAME: testenv
- LOCK_FILE: build_tools/circle/doc_linux-64_conda.lock
- GITHUB_ARTIFACT_URL: << pipeline.parameters.GITHUB_RUN_URL >>/doc.zip
steps:
- checkout
- run: ./build_tools/circle/checkout_merge_commit.sh
- restore_cache:
key: v1-doc-datasets-{{ .Branch }}
- restore_cache:
keys:
- doc-ccache-{{ .Branch }}
- doc-ccache
- run: ./build_tools/circle/build_doc.sh
- save_cache:
key: doc-ccache-{{ .Branch }}-{{ .BuildNum }}
paths:
- ~/.ccache
- ~/.cache/pip
- save_cache:
key: v1-doc-datasets-{{ .Branch }}
paths:
- ~/scikit_learn_data
- run: bash build_tools/circle/download_documentation.sh
- store_artifacts:
path: doc/_build/html/stable
destination: doc
- store_artifacts:
path: ~/log.txt
destination: log.txt
# Persists generated documentation so that it can be attached and deployed
# in the 'deploy' step.
# Persists the generated documentation, so that it
# can be attached and deployed in the "deploy" job
- persist_to_workspace:
root: doc/_build/html
paths: .

lint:
docker:
- image: cimg/python:3.8.12
steps:
- checkout
- run: ./build_tools/circle/checkout_merge_commit.sh
- run:
name: dependencies
command: pip install flake8
- run:
name: linting
command: ./build_tools/circle/linting.sh

linux-arm64:
machine:
image: ubuntu-2004:202101-01
Expand Down Expand Up @@ -127,18 +77,23 @@ jobs:

workflows:
version: 2

build-doc-and-deploy:
when:
not:
equal: [ "none", << pipeline.parameters.GITHUB_RUN_URL >> ]
# The jobs should run only when triggered by the workflow
jobs:
- lint
- doc:
requires:
- lint
- doc-min-dependencies:
requires:
- lint
- doc-min-dependencies
- doc
- deploy:
requires:
- doc

linux-arm64:
when:
equal: [ "none", << pipeline.parameters.GITHUB_RUN_URL >> ]
# Prevent double execution of this job: on push
# by default and when triggered by the workflow
jobs:
- linux-arm64
66 changes: 66 additions & 0 deletions .github/workflows/build-docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
# Workflow to build the documentation
name: Documentation builder

on:
push:
branches:
- main
# Release branches
- "[0-9]+.[0-9]+.X"
pull_request:
branches:
- main
- "[0-9]+.[0-9]+.X"

jobs:
# Build the documentation against the minimum version of the dependencies
doc-min-dependencies:
runs-on: ubuntu-latest
steps:
- name: Checkout scikit-learn
uses: actions/checkout@v2
with:
ref: ${{ github.event.pull_request.head.sha }}

- name: Setup Python
uses: actions/setup-python@v2

- name: Build documentation
run: bash build_tools/github/build_doc.sh
env:
OMP_NUM_THREADS: 2
MKL_NUM_THREADS: 2
CONDA_ENV_NAME: testenv
LOCK_FILE: build_tools/github/doc_min_dependencies_linux-64_conda.lock

- name: Upload documentation
uses: actions/upload-artifact@v2
with:
name: doc-min-dependencies
path: doc/_build/html/stable

# Build the documentation against the latest version of the dependencies
doc:
runs-on: ubuntu-latest
steps:
- name: Checkout scikit-learn
uses: actions/checkout@v2
with:
ref: ${{ github.event.pull_request.head.sha }}

- name: Setup Python
uses: actions/setup-python@v2

- name: Build documentation
run: bash build_tools/github/build_doc.sh
env:
OMP_NUM_THREADS: 2
MKL_NUM_THREADS: 2
CONDA_ENV_NAME: testenv
LOCK_FILE: build_tools/github/doc_linux-64_conda.lock

- name: Upload documentation
uses: actions/upload-artifact@v2
with:
name: doc
path: doc/_build/html/stable
26 changes: 26 additions & 0 deletions .github/workflows/trigger-hosting.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# Workflow to trigger the jobs that will host the documentation
name: Documentation push trigger
on:
workflow_run:
# Run the workflow after the separate "Documentation builder" workflow completes
workflows: [Documentation builder]
types:
- completed

jobs:
push:
runs-on: ubuntu-latest
# Run the job only if the "Documentation builder" workflow succeeded
if: ${{ github.event.workflow_run.conclusion == 'success' }}
steps:
- name: Checkout scikit-learn
uses: actions/checkout@v2

- name: Trigger hosting jobs
run: bash build_tools/github/trigger_hosting.sh
env:
CIRCLE_CI_TOKEN: ${{ secrets.CIRCLE_CI_TOKEN }}
EVENT: ${{ github.event.workflow_run.event }}
RUN_ID: ${{ github.event.workflow_run.id }}
HEAD_BRANCH: ${{ github.event.workflow_run.head_branch }}
PULL_REQUEST_NUMBER: ${{ github.event.workflow_run.pull_requests[0].number }}
8 changes: 8 additions & 0 deletions build_tools/circle/download_documentation.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/bin/bash

set -e
set -x

wget $GITHUB_ARTIFACT_URL
mkdir -p doc/_build/html/stable
unzip doc*.zip -d doc/_build/html/stable
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,21 @@ set -e
# If the inspection of the current commit fails for any reason, the default
# behavior is to quick build the documentation.

if [ -n "$GITHUB_ACTION" ]
then
# Map the variables for the new documentation builder to the old one
CIRCLE_SHA1=$(git log --no-merges -1 --pretty=format:%H)
CIRCLE_JOB=$GITHUB_JOB

if [ "$GITHUB_EVENT_NAME" == "pull_request" ]
then
CIRCLE_BRANCH=$GITHUB_HEAD_REF
CI_PULL_REQUEST=true
else
CIRCLE_BRANCH=$GITHUB_REF_NAME
fi
fi

get_build_type() {
if [ -z "$CIRCLE_SHA1" ]
then
Expand Down
21 changes: 21 additions & 0 deletions build_tools/github/trigger_hosting.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#!/bin/bash

set -e
set -x

GITHUB_RUN_URL=https://nightly.link/$GITHUB_REPOSITORY/actions/runs/$RUN_ID

if [ "$EVENT" == pull_request ]
then
BRANCH=pull/$PULL_REQUEST_NUMBER/head
else
BRANCH=$HEAD_BRANCH
fi

curl --request POST \
--url https://circleci.com/api/v2/project/gh/$GITHUB_REPOSITORY/pipeline \
--header "Circle-Token: $CIRCLE_CI_TOKEN" \
--header "content-type: application/json" \
--header "x-attribution-actor-id: github_actions" \
--header "x-attribution-login: github_actions" \
--data \{\"branch\":\"$BRANCH\",\"parameters\":\{\"GITHUB_RUN_URL\":\"$GITHUB_RUN_URL\"\}\}
4 changes: 2 additions & 2 deletions build_tools/update_environments_and_lock_files.py
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ def remove_from(alist, to_remove):
},
{
"build_name": "doc_min_dependencies",
"folder": "build_tools/circle",
"folder": "build_tools/github",
"platform": "linux-64",
"channel": "conda-forge",
"conda_dependencies": common_dependencies_without_coverage
Expand Down Expand Up @@ -242,7 +242,7 @@ def remove_from(alist, to_remove):
},
{
"build_name": "doc",
"folder": "build_tools/circle",
"folder": "build_tools/github",
"platform": "linux-64",
"channel": "conda-forge",
"conda_dependencies": common_dependencies_without_coverage
Expand Down