Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update bootstrap workflow #206

Closed
wants to merge 26 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
4179895
Chore: Bootstrap updated gitHub Actions
ModeSevenIndustrialSolutions Dec 13, 2023
71b5e4b
Chore: Bootstrap updated gitHub Actions
ModeSevenIndustrialSolutions Dec 13, 2023
f56ed84
Merge branch 'main' into main
ModeSevenIndustrialSolutions Dec 13, 2023
ddfb44b
Merge pull request #5 from ModeSevenIndustrialSolutions/main
ModeSevenIndustrialSolutions Dec 13, 2023
ae9050d
Fix: Update bootstrap first time folder handling
ModeSevenIndustrialSolutions Dec 13, 2023
41fa33a
Merge pull request #6 from ModeSevenIndustrialSolutions/update-bootst…
ModeSevenIndustrialSolutions Dec 13, 2023
afcd04b
Chore: Pull DevOps tooling from upstream repository
github-actions[bot] Dec 13, 2023
afb2aba
Merge pull request #7 from os-climate/update-devops-tooling
ModeSevenIndustrialSolutions Dec 13, 2023
a0fd63d
[dependabot] Chore: Bump affine from 2.3.0 to 2.4.0
dependabot[bot] Dec 18, 2023
5cfa84c
Chore: pre-commit autoupdate
pre-commit-ci[bot] Dec 18, 2023
f2bf89d
Merge pull request #8 from os-climate/dependabot/pip/affine-2.4.0
ModeSevenIndustrialSolutions Dec 19, 2023
4447aa5
Merge pull request #11 from os-climate/main
ModeSevenIndustrialSolutions Dec 19, 2023
2401117
Chore: Pull DevOps tooling from upstream repository
github-actions[bot] Dec 19, 2023
2a4b987
Chore: Implement pdm for build system
ModeSevenIndustrialSolutions Dec 19, 2023
09ae195
Merge pull request #13 from ModeSevenIndustrialSolutions/main
ModeSevenIndustrialSolutions Dec 19, 2023
338dbe2
Merge branch 'main' into update-devops-tooling
ModeSevenIndustrialSolutions Dec 19, 2023
bd57c4b
Merge pull request #12 from os-climate/update-devops-tooling
ModeSevenIndustrialSolutions Dec 19, 2023
f5233f7
Chore: Update DevOps tooling from central repository
github-actions[bot] Dec 19, 2023
4f9ec85
Merge pull request #14 from os-climate/update-devops-tooling
ModeSevenIndustrialSolutions Dec 19, 2023
4e9c9d4
Fix: Unb0rk pyproject.toml
ModeSevenIndustrialSolutions Dec 19, 2023
463d8a9
Merge pull request #15 from ModeSevenIndustrialSolutions/update-pypro…
ModeSevenIndustrialSolutions Dec 19, 2023
20ec318
Chore: Fix linting errors
ModeSevenIndustrialSolutions Dec 19, 2023
987103a
Merge pull request #16 from ModeSevenIndustrialSolutions/linting-updates
ModeSevenIndustrialSolutions Dec 19, 2023
1198d63
Chore: Update dependencies and pdm.lock
ModeSevenIndustrialSolutions Dec 22, 2023
6635651
Merge pull request #17 from os-climate/dep/update-pdm-lock
ModeSevenIndustrialSolutions Dec 22, 2023
08dac8b
Update bootstrap.yaml
ModeSevenIndustrialSolutions Dec 22, 2023
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
8 changes: 5 additions & 3 deletions .aicoe-ci.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
---
# Setup and configuring aicoe-ci with configuration file `.aicoe-ci.yaml`
# Example `.aicoe-ci.yaml` with a full list of config options is available here: https://github.com/AICoE/aicoe-ci/blob/master/docs/.aicoe-ci.yaml
# Example `.aicoe-ci.yaml` with a full list of config options here:
# https://github.com/AICoE/aicoe-ci/blob/master/docs/.aicoe-ci.yaml
check:
# Uncomment following line to build a public image of this repo
# - thoth-build
# Uncomment following line to build a public image of this repo
# - thoth-build
# Uncomment following lines to build a public image of this repo
# build:
# build-stratergy: Source
Expand Down
1 change: 1 addition & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ A clear and concise description of what the bug is.

**To Reproduce**
Steps to reproduce the behavior:

1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
Expand Down
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/major-release.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
name: Major release
about: Create a new major release
title: New major release
assignees: 'sesheta'
assignees: "sesheta"
labels: bot
---

Expand Down
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/minor-release.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
name: Minor release
about: Create a new minor release
title: New minor release
assignees: 'sesheta'
assignees: "sesheta"
labels: bot
---

Expand Down
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/patch-release.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
name: Patch release
about: Create a new patch release
title: New patch release
assignees: 'sesheta'
assignees: "sesheta"
labels: bot
---

Expand Down
5 changes: 2 additions & 3 deletions .github/PULL_REQUEST_TEMPLATE/POLISH_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ about: Finalize notebooks prior to publishing or promoting


## The following checklist items have been completed for each notebook in this PR:
## The following checklist items have been completed for each notebook in this PR

- [ ] Proofread by other team member for grammar and spelling
- [ ] Proofread by other team member for coherence and reproducibility (does the analysis make sense as you read through the code and markdown from top to bottom?)
Expand All @@ -25,7 +25,6 @@ about: Finalize notebooks prior to publishing or promoting
- [ ] Cell execution counts are in order (a working "run all" was performed just before PR)
- [ ] All pre-commit checks pass



## Additional context

<!-- If there is some reason that one of the above steps could not be completed, please describe what it is and why. -->
63 changes: 63 additions & 0 deletions .github/workflows/bootstrap.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
---
name: "♻️ Update shared DevOps tooling"

# yamllint disable-line rule:truthy
on:
workflow_dispatch:
schedule:
- cron: "0 8 * * MON"

jobs:
update-actions:
name: "Update DevOps tooling"
runs-on: ubuntu-latest
permissions:
# IMPORTANT: mandatory to update content/actions/PRs
contents: write
actions: write
pull-requests: write

steps:
- name: "Checkout primary repository"
uses: actions/checkout@v4
with:
# Note: Requires a specific/defined Personal Access Token
token: ${{ secrets.ACTIONS_WORKFLOW }}

- name: "Pull workflows from central repository"
uses: actions/checkout@v4
with:
repository: "os-climate/devops-toolkit"
path: ".devops"

- name: "Update repository workflows and create PR"
env:
GH_TOKEN: ${{ github.token }}
run: |
# Remove update-devops-tooling branch if it exists
git branch -d update-devops-tooling || true
git push origin --delete update-devops-tooling || true
git config user.name "github-actions[bot]"
git config user.email \
"41898282+github-actions[bot]@users.noreply.github.com"
git checkout -b "update-devops-tooling"
FOLDERS=".github .github/workflows scripts"
FILES=".pre-commit-config.yaml .prettierignore .gitignore"
for FOLDER in ${FOLDERS}; do
# If necessary, create target folder
if [ ! -d "$FOLDER" ]; then
mkdir "$FOLDER"
fi
# Update folder contents
cp -a .devops/"$FOLDER"/. "$FOLDER"
done
# Copy specified files into repository root
for FILE in ${FILES}; do
cp .devops/"$FILE" "$FILE"
done
git add .
git commit -m "Chore: Update DevOps tooling from central repository"
git push --set-upstream origin update-devops-tooling
gh pr create --title \
"Chore: Pull DevOps tooling from upstream repository" \
--body 'This process automated by a GitHub workflow: bootstrap.yaml'
60 changes: 60 additions & 0 deletions .github/workflows/builds.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
---
name: "🧪 Test builds (matrix)"

# yamllint disable-line rule:truthy
on:
workflow_dispatch:
pull_request:
types: [opened, reopened, edited, synchronize]
branches:
- "*"
- "!update-devops-tooling"

jobs:
pre-release:
# Don't run if pull request is NOT merged
# if: github.event.pull_request.merged == true
runs-on: "ubuntu-latest"
continue-on-error: true
strategy:
fail-fast: false
matrix:
python-version: ["3.9", "3.10", "3.11"]
steps:
- name: "Populate environment variables"
id: setenv
run: |
echo "Action triggered by user: ${GITHUB_TRIGGERING_ACTOR}"
set -x
datetime=$(date +'%Y%m%d%H%M')
export datetime
echo "datetime=${datetime}" >> "$GITHUB_OUTPUT"
vernum="${{ matrix.python-version }}.${datetime}"
echo "vernum=${vernum}" >> "$GITHUB_OUTPUT"

- name: "Checkout repository"
uses: actions/checkout@v4

- name: "Set up Python ${{ matrix.python-version }}"
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}

- name: "Install dependencies"
run: |
python -m pip install --upgrade pip
pip install tox tox-gh-actions

- name: "Tag for test release"
# Delete all local tags, then create a synthetic tag for testing
# Use the date/time to avoid conflicts uploading to Test PyPI
run: |
scripts/dev-versioning.sh "${{ steps.setenv.outputs.vernum }}"
git tag | xargs -L 1 | xargs git tag --delete
git tag "v${{ steps.setenv.outputs.vernum }}"
git checkout "tags/v${{ steps.setenv.outputs.vernum }}"
grep version pyproject.toml

- name: "Build with TOX"
run: |
tox -e build
27 changes: 0 additions & 27 deletions .github/workflows/ci.yml

This file was deleted.

36 changes: 36 additions & 0 deletions .github/workflows/dependencies.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
---
name: "⛔️ Update dependencies"

# yamllint disable-line rule:truthy
on:
workflow_dispatch:
schedule:
- cron: "0 8 * * FRI"

jobs:
update-dependencies:
name: "Update Python modules"
runs-on: ubuntu-latest
permissions:
# IMPORTANT: mandatory to raise the PR
id-token: write
pull-requests: write
repository-projects: write
contents: write

env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

steps:
- uses: actions/checkout@v4

- name: Update dependencies
uses: ModeSevenIndustrialSolutions/update-deps-action@v1
with:
sign-off-commit: "true"
token: ${{ secrets.GH_TOKEN }}
commit-message: "Chore: Update dependencies and pdm.lock"
pr-title: "Update Python module dependencies"
update-strategy: eager
# Whether to install PDM plugins before update
install-plugins: "false"
60 changes: 60 additions & 0 deletions .github/workflows/documentation.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
---
name: "🗒️ Build documentation"

# yamllint disable-line rule:truthy
on:
workflow_dispatch:
pull_request:
types: [closed]
branches:
- "*"
- "!update-devops-tooling"

jobs:
build_and_deploy:
# Don't run if pull request is NOT merged
if: github.event.pull_request.merged == true
name: "Rebuild documentation"
runs-on: ubuntu-latest
continue-on-error: true
strategy:
matrix:
python-version: ["3.11"]
permissions:
# IMPORTANT: mandatory for documentation updates; used in final step
id-token: write
pull-requests: write
contents: write
repository-projects: write
steps:
- name: "Checkout repository"
uses: actions/checkout@v4

- name: "Set up Python ${{ matrix.python-version }}"
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}

- name: "Setup PDM for build commands"
uses: pdm-project/setup-pdm@v3

- name: "Install dependencies"
run: |
python -m pip install --upgrade pip
pdm lock
pdm export -o requirements.txt
if [ -f docs/requirements.txt ]; then
pip install -r docs/requirements.txt; fi

- name: "Build documentation: (tox/sphinx)"
run: |
tox -e docs

- name: "Publish documentation"
if: success()
uses: peaceiris/actions-gh-pages@v3
with:
publish_branch: gh-pages
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: docs/_build/html/
keep_files: true
47 changes: 0 additions & 47 deletions .github/workflows/python-publish.yml

This file was deleted.

Loading
Loading