generated from pds-data-dictionaries/ldd-template
-
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.
- Loading branch information
0 parents
commit 42bfe15
Showing
45 changed files
with
2,066 additions
and
0 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 |
---|---|---|
@@ -0,0 +1,19 @@ | ||
# This is a comment. | ||
# Each line is a file pattern followed by one or more owners. | ||
|
||
# These owners will be the default owners for everything in | ||
# the repo. Unless a later match takes precedence, | ||
# @global-owner1 and @global-owner2 will be requested for | ||
# review when someone opens a pull request. | ||
|
||
# *************************************************************** | ||
# | ||
# Go to https://github.com/orgs/pds-data-dictionaries/teams to | ||
# find out more information about your applicable team | ||
|
||
* @pds-data-dictionaries/dldd-data-modeling-team | ||
|
||
# ************************************************************** | ||
|
||
# For more information on populating this file, go to | ||
# https://docs.github.com/en/github/creating-cloning-and-archiving-repositories/about-code-owners |
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,11 @@ | ||
# To get started with Dependabot version updates, you'll need to specify which | ||
# package ecosystems to update and where the package manifests are located. | ||
# Please see the documentation for all configuration options: | ||
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates | ||
|
||
version: 2 | ||
updates: | ||
- package-ecosystem: "github-actions" # See documentation for possible values | ||
directory: "/" # Location of package manifests | ||
schedule: | ||
interval: "monthly" |
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,27 @@ | ||
<!-- | ||
Title ^^^^ above ^^^^ should follow good commit message best practices wherever possible. | ||
A properly formed git commit subject line should always be able to complete the following sentence: | ||
If applied, this commit will <your subject line here> | ||
--> | ||
|
||
## Summary | ||
<!-- Brief summary of changes if not sufficiently described by commit messages. --> | ||
Enter summary here | ||
|
||
## Test Data and/or Report | ||
<!-- | ||
One of the following should be included here: | ||
* Reference to regression test included in code (preferred wherever reasonable) | ||
* Attach test data here + outputs of tests | ||
--> | ||
Enter info here | ||
|
||
## Related Issues | ||
<!-- | ||
Reference related issues here and use `Fixes` or `Resolves` for closing issues, for example: | ||
* Refs pds-data-dictionaries/PDS4-LDD-Issue-Repo#13 will include a link between this PR and that issue | ||
* Resolves pds-data-dictionaries/PDS4-LDD-Issue-Repo#13 will actually close the ticket once this PR is merged | ||
--> | ||
Enter related issues here |
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,113 @@ | ||
name: Build and Deploy Docs | ||
|
||
on: | ||
push: | ||
branches: | ||
- 'main' | ||
paths: | ||
- 'docs/**' | ||
- 'src/**' | ||
|
||
# Allows you to run this workflow manually from the Actions tab | ||
workflow_dispatch: | ||
|
||
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages | ||
permissions: | ||
contents: read | ||
pages: write | ||
id-token: write | ||
|
||
# Allow one concurrent deployment | ||
concurrency: | ||
group: "pages" | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
# Single deploy job since we're just deploying | ||
deploy: | ||
name: 'Build and Deploy Sphinx Docs' | ||
environment: | ||
name: github-pages | ||
url: ${{ steps.deployment.outputs.page_url }} | ||
runs-on: ubuntu-latest | ||
if: github.actor != 'pdsen-ci' | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
with: | ||
token: ${{ secrets.ADMIN_GITHUB_TOKEN || github.token }} | ||
|
||
- name: Set up Python 3 | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: '3.9' | ||
|
||
- name: Install dependencies | ||
run: | | ||
# Install Sphinx | ||
pip install -r docs/requirements.txt | ||
- name: Make Sphinx | ||
id: make | ||
run: | | ||
cd docs | ||
# Make the HTML docs and copy to main | ||
make github | ||
cd .. | ||
- name: Setup Pages | ||
uses: actions/configure-pages@v5 | ||
|
||
- name: Upload artifact | ||
uses: actions/upload-pages-artifact@v3 | ||
with: | ||
# Upload entire repository | ||
path: '.' | ||
|
||
- name: Deploy to GitHub Pages | ||
id: deployment | ||
uses: actions/deploy-pages@v4 | ||
|
||
pdfgen: # job 1 | ||
name: 'Build PDF' | ||
runs-on: ubuntu-latest | ||
if: github.actor != 'pdsen-ci' | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
token: ${{ secrets.ADMIN_GITHUB_TOKEN || github.token }} | ||
|
||
- name: Set up Python 3 | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: '3.9' | ||
|
||
- name: Install dependencies | ||
run: | | ||
# Install Sphinx | ||
pip install -r docs/requirements.txt | ||
# Update apt libraries in the event the ubuntu version | ||
# is outdated | ||
sudo apt update | ||
# Install dependencies for PDF generation | ||
sudo apt install texlive-latex-recommended texlive-fonts-recommended texlive-latex-extra latexmk | ||
- name: Generate PDF | ||
id: make | ||
run: | | ||
cd docs | ||
make latexpdf | ||
cp build/latex/*.pdf . | ||
- name: Push PDF to Github | ||
run: | | ||
git config --local user.email "[email protected]" | ||
git config --local user.name "PDSEN CI Bot" | ||
git add -A ./*.pdf | ||
git commit --allow-empty -m "Auto-gen PDF by PDSEN CI Bot" | ||
- name: Push changes | ||
uses: ad-m/github-push-action@master | ||
with: | ||
github_token: ${{ secrets.ADMIN_GITHUB_TOKEN }} | ||
branch: ${{ github.ref }} | ||
force: true |
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,208 @@ | ||
# This workflow will build a package using Maven and then publish it to GitHub packages when a release is created | ||
# For more information see: https://github.com/actions/setup-java#apache-maven-with-a-settings-path | ||
--- | ||
name: PDS4 LDD Automation | ||
on: | ||
push: | ||
branches: | ||
- '**' | ||
- '!main' | ||
- '!gh-pages' | ||
paths: | ||
- src/** | ||
- .github/** | ||
- pds4_versions.txt | ||
workflow_dispatch: | ||
|
||
env: | ||
REGRESSION_TEST_PATH: ${{ format('{0}/{1}/', github.workspace, 'test') }} | ||
# TODO - Have to hard-code this for now since Actions don't yet allow the use of env here. | ||
LOGS_PATH: ${{ format('{0}/{1}', github.workspace, 'logs') }} | ||
DEPLOY_PATH: ${{ format('{0}/{1}/{2}/{3}', github.workspace, 'build', 'development', github.sha) }} | ||
|
||
jobs: | ||
get_versions: | ||
name: Get PDS4 Versions | ||
runs-on: ubuntu-latest | ||
if: github.actor != 'pdsen-ci' | ||
outputs: | ||
matrix: ${{ steps.set-matrix.outputs.matrix }} | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
token: ${{ secrets.ADMIN_GITHUB_TOKEN || github.token }} | ||
ssh-key: ${{ secrets.SSH_KEY }} | ||
|
||
- id: set-matrix | ||
run: | | ||
# Look through lines and pull out the versions | ||
while read -r line; do | ||
if [[ ! -z "$line" ]]; then | ||
versions=$versions'"'$line'"', | ||
fi | ||
done < pds4_versions.txt | ||
versions="[${versions::-1}]" | ||
echo "{\"pds4_version\":${versions}}" | ||
# Baseline: Set pds4 version to versions from file | ||
echo "matrix={\"pds4_version\": $versions}" >> $GITHUB_OUTPUT | ||
build: | ||
name: 'Generate and Validate' | ||
needs: get_versions | ||
runs-on: ubuntu-latest | ||
if: github.actor != 'pdsen-ci' | ||
|
||
strategy: | ||
matrix: ${{fromJson(needs.get_versions.outputs.matrix)}} | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
token: ${{ secrets.ADMIN_GITHUB_TOKEN || github.token }} | ||
ssh-key: ${{ secrets.SSH_KEY }} | ||
|
||
- name: Set up Python 3 | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: '3.9' | ||
|
||
- name: Generate LDDs | ||
id: generate | ||
uses: NASA-PDS/ldd-gen-action@main | ||
with: | ||
data_path: ${{ format('{0}/{1}', env.DEPLOY_PATH, matrix.pds4_version) }} | ||
pds4_im_version: ${{ matrix.pds4_version }} | ||
pds4_development_release: ${{ matrix.pds4_development_release }} | ||
lddtool_development_release: ${{ matrix.lddtool_development_release }} | ||
test_path: ${{ env.REGRESSION_TEST_PATH }} | ||
logs_path: ${{ env.LOGS_PATH }} | ||
token: ${{ secrets.ADMIN_GITHUB_TOKEN || github.token }} | ||
|
||
- name: Check logs | ||
run: | | ||
ls -R ${{ env.LOGS_PATH }} | ||
- name: Upload LDDs to Github Action Artifacts | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: v${{matrix.pds4_version}}_LDDs | ||
path: ${{ env.DEPLOY_PATH }} | ||
if: ${{ always() }} | ||
|
||
- name: Upload Logs to Github Action Artifacts | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: v${{matrix.pds4_version}}_execution_logs | ||
path: ${{ env.LOGS_PATH }} | ||
if: ${{ always() }} | ||
|
||
upload_logs_only: # job 3 | ||
name: 'Add Run Logs to Github' | ||
runs-on: ubuntu-latest | ||
needs: build | ||
if: ${{ failure() && github.actor != 'pdsen-ci' }} | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
token: ${{ secrets.ADMIN_GITHUB_TOKEN || github.token }} | ||
ssh-key: ${{ secrets.SSH_KEY }} | ||
|
||
- uses: actions/download-artifact@v4 | ||
with: | ||
path: /tmp/artifacts | ||
|
||
- name: Display structure of downloaded files | ||
run: ls -R /tmp/artifacts | ||
|
||
- name: Clean out old logs | ||
run: | | ||
path=$(dirname ${{ env.LOGS_PATH }}) | ||
rm -fr $path/* | ||
- name: Move the execution logs to their new home | ||
run: | | ||
rm -fr ${{ env.LOGS_PATH }} | ||
mkdir -p ${{ env.LOGS_PATH }} | ||
cp -R /tmp/artifacts/*logs ${{ env.LOGS_PATH }}/ | ||
- name: Display structure of downloaded files | ||
run: ls -R ${{ env.LOGS_PATH }} | ||
|
||
- name: Push logs to Github | ||
run: | | ||
git config --local user.email "[email protected]" | ||
git config --local user.name "PDSEN CI Bot" | ||
git add -A ${{ env.LOGS_PATH }} | ||
git commit -m "Add logs from failed LDD generation" | ||
git push origin HEAD | ||
upload_all: # job 3 | ||
name: 'Add LDDs and Logs to Github' | ||
runs-on: ubuntu-latest | ||
needs: build | ||
if: ${{ github.actor != 'pdsen-ci' }} | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
token: ${{ secrets.ADMIN_GITHUB_TOKEN || github.token }} | ||
ssh-key: ${{ secrets.SSH_KEY }} | ||
|
||
- uses: actions/download-artifact@v4 | ||
with: | ||
path: /tmp/artifacts | ||
|
||
- name: Display structure of downloaded files | ||
run: | | ||
ls -R /tmp/artifacts | ||
- name: Clean previous dev/snapshot tags | ||
run: | | ||
git fetch --prune --unshallow --tags | ||
git tag -l | grep 'dev' | xargs -t -I arg sh -c 'git tag -d arg;git push --delete origin arg;' | ||
- name: Clean out old LDDs and logs | ||
run: | | ||
path=$(dirname ${{ env.DEPLOY_PATH }}) | ||
rm -fr $path/* | ||
path=${{ env.LOGS_PATH }} | ||
rm -fr $path/* | ||
- name: Move the LDDs to their new home | ||
run: | | ||
mkdir -p ${{ env.DEPLOY_PATH }} | ||
ls -R /tmp/artifacts/*LDDs/* | ||
rsync -av /tmp/artifacts/*LDDs/* ${{ env.DEPLOY_PATH }} | ||
- name: Display structure of downloaded files | ||
run: ls -R ${{ env.DEPLOY_PATH }} | ||
|
||
- name: If Release Branch, move to release dir | ||
shell: bash | ||
run: | | ||
if [[ "${{github.ref}}" == *"release"* ]]; then | ||
rsync -av /tmp/artifacts/*LDDs/* ${{github.workspace}}/build/release/ | ||
ls -R ${{github.workspace}}/build/release/ | ||
fi | ||
- name: Move the execution logs to their new home | ||
run: | | ||
rm -fr ${{ env.LOGS_PATH }} | ||
mkdir -p ${{ env.LOGS_PATH }} | ||
rsync -av /tmp/artifacts/*logs ${{ env.LOGS_PATH }}/ | ||
- name: Display structure of downloaded files | ||
run: ls -R ${{ env.LOGS_PATH }} | ||
|
||
- name: Push LDDs and Logs to Github | ||
run: | | ||
git config --local user.email "[email protected]" | ||
git config --local user.name "PDSEN CI Bot" | ||
git add -A $(dirname ${{ env.DEPLOY_PATH }}) ${{ env.LOGS_PATH }} ${{github.workspace}}/build/release/ | ||
git commit -m "Auto-generated LDDs by PDSEN CI Bot" | ||
git push origin HEAD | ||
Oops, something went wrong.