-
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.
Added command to check for dependency
- Loading branch information
1 parent
847b0c2
commit fc78644
Showing
4 changed files
with
37 additions
and
23 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,9 +9,11 @@ on: | |
required: true | ||
|
||
jobs: | ||
create_docker_image: | ||
create_submodule: | ||
permissions: | ||
contents: "write" | ||
outputs: | ||
status: ${{ steps.create_student_submodule.outcome }} | ||
|
||
runs-on: ubuntu-latest | ||
defaults: | ||
|
@@ -22,32 +24,55 @@ jobs: | |
- name: Checkout | ||
uses: actions/checkout@v3 | ||
|
||
- name: Set up Python | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: "3.10" | ||
|
||
- name: Install Github dependents info | ||
run: pip install -U github-dependents-info | ||
|
||
- id: create_student_submodule | ||
- name: Add student's repo as a submodule | ||
run: | | ||
year=$(date '+%Y') | ||
user_name=$(echo "${{ github.event.inputs.githubRepo }}" | cut -d'/' -f4) | ||
repo_name=$(echo "${{ github.event.inputs.githubRepo }}" | cut -d'/' -f5) | ||
if [ ! -d submissions-${year}/${user_name}-${repo_name} ]; then | ||
echo "Adding ${{ github.event.inputs.githubRepo }} to ./submissions-${year}/${user_name}-${repo_name} as a submodule" | ||
echo "Adding ${{ github.event.inputs.githubRepo }} to ./submissions-${year}/${user_name}-${repo_name}/${user_name}-${repo_name} as a submodule" | ||
git config --global user.name github-actions | ||
git config --global user.email [email protected] | ||
git submodule add ${{ github.event.inputs.githubRepo }} ./submissions-${year}/${user_name}-${repo_name} | ||
git submodule add ${{ github.event.inputs.githubRepo }} ./submissions-${year}/${user_name}-${repo_name}/${user_name}-${repo_name} | ||
git commit -m "Added ${user_name}-${repo_name} as a submodule by github-actions" | ||
git push | ||
else | ||
echo "Submodule already exists, terminating github actions" | ||
fi | ||
cd ./submissions-${year}/${user_name}-${repo_name} | ||
cd ./submissions-${year}/${user_name}-${repo_name}/ | ||
create_docker_image: | ||
permissions: | ||
contents: "write" | ||
needs: create_submodule | ||
runs-on: ubuntu-latest | ||
defaults: | ||
run: | ||
shell: bash | ||
|
||
if: needs.create_submodule.outputs.status == "success" | ||
steps: | ||
- name: Set up Python | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: "3.10" | ||
|
||
- name: Install Github dependents info | ||
run: pip install -U github-dependents-info | ||
|
||
- name: Get submodule's dependencies in JSON file | ||
run: github-dependents-info --repo ${user_name}/${repo_name} --json | ||
|
||
- name: Check if the JSON file was created successfully | ||
run: | | ||
if [[ -f ${user_name}/${repo_name}.json ]]; then | ||
echo "${user_name}/${repo_name}.json exists!" | ||
else | ||
echo "${user_name}/${repo_name}.json does not exist!" | ||
fi | ||
# need to add export DOCKER_BUILDKIT=1 before building python docker image |
This file was deleted.
Oops, something went wrong.
Submodule lillywallawitsch-Wondernest.Express
deleted from
837425
Submodule maggieekubat-Recipe
deleted from
a4c63a