forked from AlexsLemonade/OpenScPCA-analysis
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'AlexsLemonade:main' into main
- Loading branch information
Showing
248 changed files
with
94,616 additions
and
5,513 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
Oops, something went wrong.