Skip to content

Commit

Permalink
Workflow debug
Browse files Browse the repository at this point in the history
  • Loading branch information
atharva-2001 committed Dec 11, 2024
1 parent 0c5a927 commit d952d16
Show file tree
Hide file tree
Showing 2 changed files with 64 additions and 57 deletions.
119 changes: 63 additions & 56 deletions .github/workflows/build-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,26 @@
#
# https://tardis-sn.github.io/tardis/contributing/development/continuous_integration.html

name: docs
name: docs-debug

on:
push:
branches:
- master

pull_request_target:
pull_request:
branches:
- master

types:
- opened
- reopened
- synchronize
- labeled # requires the `build-docs` label
- ready_for_review
# pull_request_target:
# branches:
# - master

# types:
# - opened
# - reopened
# - synchronize
# - labeled # requires the `build-docs` label
# - ready_for_review

workflow_dispatch: # manual trigger

Expand All @@ -27,58 +30,58 @@ env:
DEPLOY_BRANCH: gh-pages # deployed docs branch
HDF5_USE_FILE_LOCKING: "FALSE" # disable file locking

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.ref }}
cancel-in-progress: true
# concurrency:
# group: ${{ github.workflow }}-${{ github.head_ref || github.ref }}
# cancel-in-progress: true

defaults:
run:
shell: bash -l {0}
shell: bash -el {0}

jobs:
check-for-changes:
runs-on: ubuntu-latest
if: ${{ !github.event.pull_request.draft }}
outputs:
trigger-check-outcome: ${{ steps.trigger_check.outcome }}
docs-check-outcome: ${{ steps.docs_check.outcome }}
steps:
- uses: actions/checkout@v4
if: github.event_name != 'pull_request_target'

- name: Checkout pull/${{ github.event.number }}
uses: actions/checkout@v4
with:
fetch-depth: 0
ref: ${{ github.event.pull_request.head.sha }}
if: github.event_name == 'pull_request_target'

- name: Check for trigger by push event, manual dispatch, build-docs label on a PR
id: trigger_check
if: github.event_name == 'push' || github.event_name == 'workflow_dispatch' || github.event_name == 'pull_request_target' && contains(github.event.pull_request.labels.*.name, 'build-docs')
run: |
echo "Building docs as a test."
exit 0
continue-on-error: true

- name: Check for changes in documentation
run: |
if git diff origin/master..."$(git rev-parse --abbrev-ref HEAD)" --name-only | cat | grep '^docs/' | grep -q .; then
num_files=$(git diff --name-only origin/master...HEAD | grep '^docs/' | wc -l)
echo "Changes found in documentation files: $num_files"
exit 0
else
echo "No changes found in documentation files - will stop running the pipeline."
exit 1
fi
id: docs_check
if: steps.trigger_check.outcome != 'success'
continue-on-error: true
# check-for-changes:
# runs-on: ubuntu-latest
# if: ${{ !github.event.pull_request.draft }}
# outputs:
# trigger-check-outcome: ${{ steps.trigger_check.outcome }}
# docs-check-outcome: ${{ steps.docs_check.outcome }}
# steps:
# - uses: actions/checkout@v4
# if: github.event_name != 'pull_request_target'

# - name: Checkout pull/${{ github.event.number }}
# uses: actions/checkout@v4
# with:
# fetch-depth: 0
# ref: ${{ github.event.pull_request.head.sha }}
# if: github.event_name == 'pull_request_target'

# - name: Check for trigger by push event, manual dispatch, build-docs label on a PR
# id: trigger_check
# if: github.event_name == 'push' || github.event_name == 'workflow_dispatch' || github.event_name == 'pull_request_target' && contains(github.event.pull_request.labels.*.name, 'build-docs')
# run: |
# echo "Building docs as a test."
# exit 0
# continue-on-error: true

# - name: Check for changes in documentation
# run: |
# if git diff origin/master..."$(git rev-parse --abbrev-ref HEAD)" --name-only | cat | grep '^docs/' | grep -q .; then
# num_files=$(git diff --name-only origin/master...HEAD | grep '^docs/' | wc -l)
# echo "Changes found in documentation files: $num_files"
# exit 0
# else
# echo "No changes found in documentation files - will stop running the pipeline."
# exit 1
# fi
# id: docs_check
# if: steps.trigger_check.outcome != 'success'
# continue-on-error: true

build-docs:
runs-on: ubuntu-latest
needs: check-for-changes
if: needs.check-for-changes.outputs.trigger-check-outcome == 'success' || needs.check-for-changes.outputs.docs-check-outcome == 'success'
# needs: check-for-changes
# if: needs.check-for-changes.outputs.trigger-check-outcome == 'success' || needs.check-for-changes.outputs.docs-check-outcome == 'success'
steps:
- uses: actions/checkout@v4
if: github.event_name != 'pull_request_target'
Expand All @@ -98,10 +101,14 @@ jobs:
sparse-checkout: |
atom_data/kurucz_cd23_chianti_H_He.h5
- name: Setup environment
uses: ./.github/actions/setup_env
- uses: mamba-org/setup-micromamba@v2
with:
os-label: linux-64
environment-file: tardis-env3.yml
environment-name: tardis
init-shell: bash
post-cleanup: 'all'
# cache-environment: true
# cache-downloads: true

- name: Copy atom_data
run: |
Expand Down
2 changes: 1 addition & 1 deletion tardis_env3.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ dependencies:
- tqdm

# Widgets & Visualization
- notebook=6.5.7
- notebook=7.3.0
- matplotlib-base
- ipywidgets
- plotly
Expand Down

0 comments on commit d952d16

Please sign in to comment.