Skip to content

Commit

Permalink
Merge branch 'AlexsLemonade:main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
allyhawkins authored Jul 24, 2024
2 parents 4162f8e + 61a24b0 commit 5630d98
Show file tree
Hide file tree
Showing 248 changed files with 94,616 additions and 5,513 deletions.
11 changes: 7 additions & 4 deletions .github/ISSUE_TEMPLATE/create-a-semantic-version-release.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,18 @@ If issues must be resolved before creating a release, mark them as blockers in Z
**Pre-release checklist:**

- [ ] Any mentions of the release tag in the repository have been updated
- [ ] All scheduled workflows are passing
- [ ] [Run all analysis modules](https://github.com/AlexsLemonade/OpenScPCA-analysis/actions/workflows/all_modules.yml) (trigger manually if needed)
- [ ] All maintenance workflows are passing
- [ ] [Run all analysis modules](https://github.com/AlexsLemonade/OpenScPCA-analysis/actions/workflows/run_all-modules.yml) (trigger manually if needed)<br>
Check that all analysis modules are present in the workflow before running, and file a PR updating the workflow if necessary.
- [ ] [Spellcheck](https://github.com/AlexsLemonade/OpenScPCA-analysis/actions/workflows/spellcheck.yml) (trigger manually if needed)
- [ ] Code styling
- [ ] [Code styling](https://github.com/AlexsLemonade/OpenScPCA-analysis/actions/workflows/code-styling.yml) (optional, trigger manually)
- [ ] All blocking issues have been resolved
- [ ] Write release notes, which should include the following:
- [ ] Write release notes and add them to [`CHANGELOG.md`](https://github.com/AlexsLemonade/OpenScPCA-analysis/blob/main/CHANGELOG.md), which should include the following:
- Which modules have been added, if any?
- Which modules have been deprecated, if any?
- What has changed in the repo documentation, if anything?
- Are there any _major_ shifts in project dependencies?
For example, is there a package that was used throughout Docker environments that has been replaced?
- Have there been any changes in repo file organization?
- [ Create a release on GitHub ](https://github.com/AlexsLemonade/OpenScPCA-analysis/releases/new)
- populate the contents with the release notes added to the changelog.
61 changes: 56 additions & 5 deletions .github/components/dictionary.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,53 +4,87 @@ ADT
al
ALSF
altExp
aneuploid
AnnData
anonymize
anonymized
astrocytes
AUCell
authenticator
barcode
barcodes
Beligs
benchmarking
Bioconda
Bioconductor
bioinformatics
Bleijs
Carpentries
CellAssign
chondrocytes
chr
CLI
Cmd
CNA
CNAs
CNV
CNVs
codebase
conda
config
Cmd
CopyKAT
CRediT
Crompton
Ctrl
cxds
demultiplexing
dendogram
designee
discoverable
docstring
docstrings
DM
DNT
Docker's
Dockerfile
docstring
docstrings
DOI
doxxing
dropdown
ECM
ECR
enforceability
Ensembl
enure
erythematosus
et
ewings
EWS-FLI1
fibroblast
fibroblasts
formatters
Generis
GFM
GHA
GHAs
GitHub
GitKraken
GitKraken's
Goodspeed
GPUs
GTF
heterotypic
homotypic
HPC
IAM
ICJME
ie
ies
immunities
impactful
indicia
InferCNV
Jaccard
Jitter
JSON
Jupyter
LGBTQ
Expand All @@ -67,35 +101,47 @@ LSfR
macOS
md
merchantability
mesenchymal
metacell
metacells
Miniconda
misidentification
MSC
multifactor
natively
Nextflow
nonconsensual
octicons
onboarded
OpenScPCA
openscpca
OpenScPCA
OpenScPCA's
Panglao
PanglaoDB
PDX
pluripotent
Posit
Posit's
PowerShell
pre
PR
pre
PRs
README
redistribution
redistributions
renv
repo
reproducibility
reproducibly
RStudio
RStudio's
Rtools
SaaS
scDblFinder
SCE
ScPCA
SCPCP
scrublet
SemVar
SingleR
socio
Expand All @@ -105,12 +151,16 @@ sublicensable
symlink
symlinked
synched
TBD
Tirode
trainings
transferrable
transphobic
triaged
TSV
UCell
UMAP
uncomment
vCPU
vCPUs
Visser
Expand All @@ -121,3 +171,4 @@ WSL
Xcode
YAML
Zappia
Zenodo
7 changes: 7 additions & 0 deletions .github/cron-issue-templates/all-docker-issue-template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
At least one of the Docker images that is part of the [Build all Docker images](https://github.com/AlexsLemonade/OpenScPCA-analysis/actions/workflows/docker_all-modules.yml) workflow has failed.

Check the latest output from the workflow at the following link to see which module failed.
https://github.com/AlexsLemonade/OpenScPCA-analysis/actions/workflows/docker_all-modules.yml

Then assign an OpenScPCA admin to this issue and add to this issue a list of the modules with failing docker builds.
Alternatively, file a new issue for each failing Docker image.
4 changes: 2 additions & 2 deletions .github/cron-issue-templates/all-modules-issue-template.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
At least one of the modules that is part of the [Run all analysis modules](https://github.com/AlexsLemonade/OpenScPCA-analysis/actions/workflows/all_modules.yml) workflow has failed.
At least one of the modules that is part of the [Run all analysis modules](https://github.com/AlexsLemonade/OpenScPCA-analysis/actions/workflows/run_all-modules.yml) workflow has failed.

Check the latest output from the workflow at the following link to see which module failed.
https://github.com/AlexsLemonade/OpenScPCA-analysis/actions/workflows/all_modules.yml
https://github.com/AlexsLemonade/OpenScPCA-analysis/actions/workflows/run_all-modules.yml

Then assign an OpenScPCA admin to this issue and add to this issue a list of the failing modules.
Alternatively, file a new issue for each failing module.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ Create a periodic release using [the periodic release workflow](https://github.c
#### Pre-release checklist

- [ ] All scheduled workflows are passing
- [ ] [Run all analysis modules](https://github.com/AlexsLemonade/OpenScPCA-analysis/actions/workflows/all_modules.yml) (trigger manually if needed)
- [ ] [Run all analysis modules](https://github.com/AlexsLemonade/OpenScPCA-analysis/actions/workflows/run_all-modules.yml) (trigger manually if needed)
- [ ] [Spellcheck](https://github.com/AlexsLemonade/OpenScPCA-analysis/actions/workflows/spellcheck.yml) (trigger manually if needed)
- [ ] Code styling
- [ ] All blocking issues have been resolved
4 changes: 3 additions & 1 deletion .github/cron-issue-templates/spellcheck-issue-template.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,6 @@ Spellcheck found **{{ERROR_COUNT}} errors**.

- [ ] Assign an OpenScPCA admin
- [ ] Spell check errors have been fixed via a PR
- [ ] Spell check workflow has been manually run to confirm spelling errors are fixed
- [ ] Spell check workflow has been run to confirm spelling errors are fixed.<br>
If the PR branch has a name that starts with `spelling/` and the `dictionary.txt` file is updated, the spell check workflow will run automatically.
Otherwise the spell check workflow may need to be run manually.
67 changes: 67 additions & 0 deletions .github/workflows/build-push-docker-module.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
name: Build and push a Docker image for a module
# This action is meant to be called by other actions,
# namely the `build-docker-modules` job in `docker_all-modules.yml` and
# the `build-push` job in `docker_{module}.yml` for each analysis module.

on:
workflow_call:
inputs:
module:
required: true
type: string
push-ecr:
description: "Push to AWS ECR"
type: boolean

permissions:
id-token: write
contents: read

jobs:
build-push:
name: Build and Push Docker Image
if: inputs.push-ecr && github.repository_owner == 'AlexsLemonade'
environment: prod
runs-on: ubuntu-latest

steps:
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: arn:aws:iam::992382809252:role/GithubOpenId
role-session-name: githubActionSession
aws-region: us-east-1

- name: Log in to Amazon ECR
id: login-ecr
uses: aws-actions/amazon-ecr-login@v2
with:
registry-type: public

- name: Create ECR repository if needed
id: create-ecr
run: |
aws ecr-public describe-repositories --repository-names ${{ inputs.module }} \
|| aws ecr-public create-repository --repository-name ${{ inputs.module }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Docker metadata
id: meta
uses: docker/metadata-action@v5
with:
images: public.ecr.aws/openscpca/${{ inputs.module }}
# tag with 'latest' for main branch pushes, semantic version for releases/tags
tags: |
type=raw,value=latest,enable={{is_default_branch}}
type=semver,pattern={{raw}}
- name: Build and push image
uses: docker/build-push-action@v5
with:
push: true
context: "{{defaultContext}}:analyses/${{ inputs.module }}"
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
6 changes: 5 additions & 1 deletion .github/workflows/check-links.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
name: Check docs links
on:
pull_request:
branches: main
branches:
- main
- feature/*
paths:
- docs/**

jobs:
check-docs-links:
if: github.repository_owner == 'AlexsLemonade'
runs-on: ubuntu-latest
name: Check links

Expand All @@ -26,6 +29,7 @@ jobs:
# Capture all the bad links (don't let grep exit -1 if no match)
grep "relative link" build-log.txt > bad_links.txt || true
grep "no such anchor" build-log.txt >> bad_links.txt || true
# Save the number of bad links to github output
echo "n_bad_links=$(wc -l < bad_links.txt)" >> "$GITHUB_OUTPUT"
Expand Down
72 changes: 72 additions & 0 deletions .github/workflows/code-styling.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
name: Code styling
on:
#pull_request:
# branches:
# - main
workflow_dispatch:
# schedule:
# - cron: "0 0 15 1/3 *" # 15th of every 3rd month, for now


concurrency:
# only one run per branch at a time
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true


jobs:
style-code:
runs-on: ubuntu-latest
name: Perform code styling

steps:
- name: Checkout repo
uses: actions/checkout@v4

## First, style the R code ##
- name: Install R
uses: r-lib/actions/setup-r@v2

- name: Install R dependencies
run: install.packages(c("styler", "knitr", "roxygen2"), repos = "https://p3m.dev/cran/__linux__/jammy/latest")
shell: Rscript --no-init-file {0}

- name: Style analysis modules R code
run: |
list.files(
"analyses",
recursive = TRUE,
full.names = TRUE,
pattern = "\\.(r|rmd)$", ignore.case = TRUE
) |>
# do not style renv/activate.R
purrr::discard(\(x) grepl("renv/activate.R", x)) |>
# perform styling
styler::style_file()
shell: Rscript --no-init-file {0}


## Second, style the python code ##
- name: Format python files
uses: chartboost/ruff-action@v1
with:
args: format analyses/

- name: Create PR with styled code
uses: peter-evans/create-pull-request@v6 # defaults to ${GITHUB_TOKEN} token
with:
commit-message: Styled code
signoff: false
branch: style-analysis-modules
base: main
delete-branch: true
title: "GHA: Automated analysis module code styling"
body: |
### Description:
This PR was auto-generated by GitHub Actions to style all R (scripts and notebooks) and Python (scripts only) code in `analyses`.
### Instruction for reviewers:
Make sure that all code changes are acceptable.
labels: |
OpenScPCA admin
code styling
Loading

0 comments on commit 5630d98

Please sign in to comment.