diff --git a/.github/workflows/blank.yml b/.github/workflows/blank.yml index 8a57aeb..3617f56 100644 --- a/.github/workflows/blank.yml +++ b/.github/workflows/blank.yml @@ -12,15 +12,131 @@ on: # A workflow run is made up of one or more jobs that can run sequentially or in parallel jobs: + github-context: + runs-on: ubuntu-latest + steps: + - name: Dump github context + run: echo "$GITHUB_CONTEXT" + shell: bash + env: + GITHUB_CONTEXT: ${{ toJson(github) }} + + matrix-testing: + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + os: [ "ubuntu-latest", "macos-latest"] + python-version: [ "3.7", "3.8", "3.9"] + wo_gurobi: ["", "without gurobi"] + include: + - os: "ubuntu-latest" + minizinc_path: $(pwd)/bin + - os: "macos-latest" + minizinc_path: $(pwd)/bin/MiniZincIDE.app/Contents/Resources + - coverage: false + - os: "ubuntu-latest" + python-version: "3.9" + wo_gurobi: "" + coverage: true + exclude: + - os: "macos-latest" + wo_gurobi: "without gurobi" + - os: "ubuntu-latest" + wo_gurobi: "without gurobi" + python-version: 3.7 + - os: "ubuntu-latest" + wo_gurobi: "without gurobi" + python-version: 3.8 + + steps: + - name: on teste la matrice + run: | + echo ${{ matrix.wo_gurobi }} + echo ${{ matrix.minizinc_path }} + if [ "${{ matrix.wo_gurobi }}" = "without gurobi" ]; then + echo pip install gurobipy + fi + echo ${{ matrix.coverage }} + if ${{ matrix.coverage }}; then + echo "Add a coverage report" + fi + - name: on fait pytest normal + if: ${{ !matrix.coverage }} + run: echo "pytest" + - name: on fait pytest avec coverage + if: ${{ matrix.coverage }} + run: echo "pytest --cov" + # This workflow contains a single job called "build" build: # The type of runner that the job will run on runs-on: ubuntu-latest - + env: + python_version: "3.7" # Steps represent a sequence of tasks that will be executed as part of the job steps: # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - - uses: actions/checkout@v2 + - name: Setup python + uses: actions/setup-python@v2 + with: + python-version: ${{ env.python_version }} + - name: Test python + run: python --version + - name: Checkout all branches + uses: actions/checkout@v2 + with: + submodules: true + fetch-depth: 0 # fetch all branches + + - name: build master doc (fake it by appending a word) + run: | + git show origin/gh-pages:yo.md > doc/yo.md + echo "yo" >> doc/yo.md + + - name: Deploy documentation in root folder on GH pages 🚀 + uses: JamesIves/github-pages-deploy-action@4.1.5 + with: + branch: gh-pages # The branch the action should deploy to. + folder: doc # The folder the action should deploy. + target-folder: / # The folder the action should deploy to. + commit-message: publish documentation for master + clean-exclude: | + "version/*" + + - name: Checkout all branches + uses: actions/checkout@v2 + with: + submodules: true + fetch-depth: 0 # fetch all branches + + - name: Squash last master doc commits on gh_pages + run: | + git checkout gh-pages + # check if two last commits are for same doc + last_commit_title=$(git log HEAD -1 --format=%s) + second_to_last_commit_title=$(git log HEAD~1 -1 --format=%s) + echo $last_commit_title + echo $second_to_last_commit_title + if [[ $last_commit_title == $second_to_last_commit_title ]]; then + echo "Merge two last commits" + git reset --soft HEAD~ + git config user.name "Actions" + git config user.email "actions@github.com" + git commit --amend --no-edit + git push -f origin gh-pages + fi + + + - name: Tests + run: | + echo $GITHUB_REF + echo ${{ github.ref }} + echo ${{ github.ref_name }} + echo ${{ github.head_ref }} + echo ${{ github.base_ref }} + echo ${{ github.repository }} + echo $GITHUB_REPOSITORY - name: Set env variables for github+binder links in doc run: | @@ -53,6 +169,8 @@ jobs: echo ${AUTODOC_NOTEBOOKS_REPO_URL} echo ${AUTODOC_NOTEBOOKS_BRANCH} + echo nb_branch: ${{ env.AUTODOC_NOTEBOOKS_BRANCH }} + # Runs a single command using the runners shell - name: Run a one-line script run: echo ${{ github.ref }} @@ -65,4 +183,3 @@ jobs: - name: deploy if: ${{ github.ref == 'refs/heads/main' }} run: echo deploy - diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index b7a9b44..7ea876b 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -10,39 +10,44 @@ on: # A workflow run is made up of one or more jobs that can run sequentially or in parallel jobs: - # This workflow contains a single job called "build" - build: - # The type of runner that the job will run on + create-binder-env: runs-on: ubuntu-latest - - # Steps represent a sequence of tasks that will be executed as part of the job steps: - # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it + - name: Get scikit-decide release version and define new binder env tag + run: | + TAG_NAME=${GITHUB_REF/refs\/tags\//} # stripping "refs/tags/" + SKDECIDE_VERSION=${TAG_NAME/v/} # stripping "v" + BINDER_TAG=binder_${TAG_NAME} + echo "BINDER_TAG=${BINDER_TAG}" >> $GITHUB_ENV + echo "SKDECIDE_VERSION=${SKDECIDE_VERSION}" >> $GITHUB_ENV + echo "DOCS_VERSION_PATH=/version/$SKDECIDE_VERSION/" >> $GITHUB_ENV + + # Checks-out current branch - uses: actions/checkout@v2 + - name: Deploy 🚀 + uses: JamesIves/github-pages-deploy-action@4.1.5 + with: + branch: gh-pages # The branch the action should deploy to. + folder: doc # The folder the action should deploy. + target-folder: ${{ env.DOCS_VERSION_PATH }} # The folder the action should deploy to. + commit-message: publish documentation for release ${{ env.SKDECIDE_VERSION }} + clean: false # Releasing a new version is about creating a new directory, so we don't want to clean up the root. + + build-docs: + runs-on: ubuntu-latest + env: + DOCS_VERSION_PATH: / + + steps: - name: Set env variables for github+binder links in doc run: | - # binder environment repo and branch - AUTODOC_BINDER_ENV_GH_REPO_NAME="airbus/scikit-decide" - AUTODOC_BINDER_ENV_GH_BRANCH="binder" - # notebooks source repo and branch depending if it is a commit push or a PR - if [[ $GITHUB_REF == refs/pull* ]]; - then - AUTODOC_NOTEBOOKS_REPO_URL="${GITHUB_SERVER_URL}/${{ github.event.pull_request.head.repo.full_name }}" - AUTODOC_NOTEBOOKS_BRANCH=${GITHUB_HEAD_REF} - elif [[ $GITHUB_REF == refs/heads* ]]; - then - AUTODOC_NOTEBOOKS_REPO_URL=${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY} - AUTODOC_NOTEBOOKS_BRANCH=${GITHUB_REF/refs\/heads\//} - fi - # export in GITHUB_ENV for next steps - echo "AUTODOC_BINDER_ENV_GH_REPO_NAME=${AUTODOC_BINDER_ENV_GH_REPO_NAME}" >> $GITHUB_ENV - echo "AUTODOC_BINDER_ENV_GH_BRANCH=${AUTODOC_BINDER_ENV_GH_BRANCH}" >> $GITHUB_ENV - echo "AUTODOC_NOTEBOOKS_REPO_URL=${AUTODOC_NOTEBOOKS_REPO_URL}" >> $GITHUB_ENV - echo "AUTODOC_NOTEBOOKS_BRANCH=${AUTODOC_NOTEBOOKS_BRANCH}" >> $GITHUB_ENV - # check computed variables - echo "Binder env: ${AUTODOC_BINDER_ENV_GH_REPO_NAME}/${AUTODOC_BINDER_ENV_GH_BRANCH}" - echo "Notebooks source: ${AUTODOC_NOTEBOOKS_REPO_URL}/tree/${AUTODOC_NOTEBOOKS_BRANCH}" + TAG_NAME=${GITHUB_REF/refs\/tags\//} # stripping "refs/tags/" + BINDER_TAG=binder_${TAG_NAME} + echo "AUTODOC_BINDER_ENV_GH_REPO_NAME=airbus/scikit-decide" >> $GITHUB_ENV + echo "AUTODOC_BINDER_ENV_GH_BRANCH=${BINDER_TAG}" >> $GITHUB_ENV + echo "AUTODOC_NOTEBOOKS_REPO_URL=${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}" >> $GITHUB_ENV + echo "AUTODOC_NOTEBOOKS_BRANCH=${TAG_NAME}" >> $GITHUB_ENV - name: read binder env run: | @@ -50,17 +55,3 @@ jobs: echo ${AUTODOC_BINDER_ENV_GH_BRANCH} echo ${AUTODOC_NOTEBOOKS_REPO_URL} echo ${AUTODOC_NOTEBOOKS_BRANCH} - - # Runs a single command using the runners shell - - name: Run a one-line script - run: echo ${{ github.ref }} - - # Runs a set of commands using the runners shell - - name: Run a multi-line script - run: | - echo Add other actions to build, - echo test, and deploy your project. - - name: deploy - if: ${{ github.ref == 'refs/heads/main' }} - run: echo deploy - diff --git a/.github/workflows/workflow2.yml b/.github/workflows/workflow2.yml deleted file mode 100644 index e8a1cf6..0000000 --- a/.github/workflows/workflow2.yml +++ /dev/null @@ -1,26 +0,0 @@ -# This is a basic workflow to help you get started with Actions - -name: workflow 2 - -# Controls when the workflow will run -on: - workflow_run: - workflows: - - CI 🔨 - types: - - completed - # Allows you to run this workflow manually from the Actions tab - workflow_dispatch: - -# A workflow run is made up of one or more jobs that can run sequentially or in parallel -jobs: - # This workflow contains a single job called "build" - build: - # The type of runner that the job will run on - runs-on: ubuntu-latest - - # Steps represent a sequence of tasks that will be executed as part of the job - steps: - # Runs a single command using the runners shell - - name: Run a one-line script - run: echo "workflow 2 working!" diff --git a/.github/workflows/workflow3.yml b/.github/workflows/workflow3.yml deleted file mode 100644 index 10b2973..0000000 --- a/.github/workflows/workflow3.yml +++ /dev/null @@ -1,32 +0,0 @@ -# This is a basic workflow to help you get started with Actions - -name: workflow 3 - -# Controls when the workflow will run -on: - workflow_run: - workflows: - - CI 🔨 - types: - - completed - - # Allows you to run this workflow manually from the Actions tab - workflow_dispatch: - -# A workflow run is made up of one or more jobs that can run sequentially or in parallel -jobs: - # This workflow contains a single job called "build" - build: - if: ${{ github.event.workflow_run.conclusion == 'success' }} - # The type of runner that the job will run on - runs-on: ubuntu-latest - - # Steps represent a sequence of tasks that will be executed as part of the job - steps: - - uses: actions/checkout@v2 - # Runs a single command using the runners shell - - name: Run a one-line script - run: echo "workflow 3 working on other branch!" - - name: only on main - run: echo "only on main branch" - if: ${{ github.event.workflow_run.head_branch == 'main' }} \ No newline at end of file diff --git a/doc/a b/doc/a new file mode 100644 index 0000000..e69de29 diff --git a/doc/anpother b/doc/anpother new file mode 100644 index 0000000..e69de29 diff --git a/doc/b b/doc/b new file mode 100644 index 0000000..e69de29 diff --git a/doc/c b/doc/c new file mode 100644 index 0000000..e69de29 diff --git a/doc/masterreadme.md b/doc/masterreadme.md new file mode 100644 index 0000000..e69de29 diff --git a/doc/newone b/doc/newone new file mode 100644 index 0000000..e69de29 diff --git a/doc/yo.md b/doc/yo.md new file mode 100644 index 0000000..a5e03e6 --- /dev/null +++ b/doc/yo.md @@ -0,0 +1,3 @@ +\nyo +\nyo +yo diff --git a/new_feature b/new_feature new file mode 100644 index 0000000..e69de29