Skip to content
This repository was archived by the owner on Jul 29, 2024. It is now read-only.

Commit 81ff4a4

Browse files
Initial checkin (#1)
2 parents 7ed4d28 + 665d352 commit 81ff4a4

File tree

17 files changed

+1103
-2
lines changed

17 files changed

+1103
-2
lines changed

.github/workflows/codeql.yml

Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
# For most projects, this workflow file will not need changing; you simply need
2+
# to commit it to your repository.
3+
#
4+
# You may wish to alter this file to override the set of languages analyzed,
5+
# or to provide custom queries or build logic.
6+
#
7+
# ******** NOTE ********
8+
# We have attempted to detect the languages in your repository. Please check
9+
# the `language` matrix defined below to confirm you have the correct set of
10+
# supported CodeQL languages.
11+
#
12+
name: "CodeQL"
13+
14+
on:
15+
push:
16+
branches: [ "main" ]
17+
pull_request:
18+
branches: [ "main" ]
19+
schedule:
20+
- cron: '32 17 * * 0'
21+
22+
jobs:
23+
analyze:
24+
name: Analyze
25+
# Runner size impacts CodeQL analysis time. To learn more, please see:
26+
# - https://gh.io/recommended-hardware-resources-for-running-codeql
27+
# - https://gh.io/supported-runners-and-hardware-resources
28+
# - https://gh.io/using-larger-runners
29+
# Consider using larger runners for possible analysis time improvements.
30+
runs-on: ${{ (matrix.language == 'swift' && 'macos-latest') || 'ubuntu-latest' }}
31+
timeout-minutes: ${{ (matrix.language == 'swift' && 120) || 360 }}
32+
permissions:
33+
# required for all workflows
34+
security-events: write
35+
36+
# only required for workflows in private repositories
37+
actions: read
38+
contents: read
39+
40+
strategy:
41+
fail-fast: false
42+
matrix:
43+
language: [ 'python' ]
44+
# CodeQL supports [ 'c-cpp', 'csharp', 'go', 'java-kotlin', 'javascript-typescript', 'python', 'ruby', 'swift' ]
45+
# Use only 'java-kotlin' to analyze code written in Java, Kotlin or both
46+
# Use only 'javascript-typescript' to analyze code written in JavaScript, TypeScript or both
47+
# Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support
48+
49+
steps:
50+
- name: Checkout repository
51+
uses: actions/checkout@v4
52+
53+
# Initializes the CodeQL tools for scanning.
54+
- name: Initialize CodeQL
55+
uses: github/codeql-action/init@v3
56+
with:
57+
languages: ${{ matrix.language }}
58+
# If you wish to specify custom queries, you can do so here or in a config file.
59+
# By default, queries listed here will override any specified in a config file.
60+
# Prefix the list here with "+" to use these queries and those in the config file.
61+
62+
# For more details on CodeQL's query packs, refer to: https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
63+
# queries: security-extended,security-and-quality
64+
65+
66+
# Autobuild attempts to build any compiled languages (C/C++, C#, Go, Java, or Swift).
67+
# If this step fails, then you should remove it and run the build manually (see below)
68+
- name: Autobuild
69+
uses: github/codeql-action/autobuild@v3
70+
71+
# ℹ️ Command-line programs to run using the OS shell.
72+
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
73+
74+
# If the Autobuild fails above, remove it and uncomment the following three lines.
75+
# modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance.
76+
77+
# - run: |
78+
# echo "Run, Build Application using script"
79+
# ./location_of_script_within_repo/buildscript.sh
80+
81+
- name: Perform CodeQL Analysis
82+
uses: github/codeql-action/analyze@v3
83+
with:
84+
category: "/language:${{matrix.language}}"

.github/workflows/standard.yaml

Lines changed: 177 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,177 @@
1+
# ----------------------------------------------------------------------
2+
# SPDX-FileCopyrightText: 2024 Scientific Software Engineering Center <ssec-dev@gatech.edu>
3+
# SPDX-License-Identifier: MIT
4+
# ----------------------------------------------------------------------
5+
name: "Standard"
6+
7+
run-name: ${{ github.run_number }} [${{ github.actor }}] on ${{ github.ref_name }}
8+
9+
on:
10+
pull_request:
11+
branches:
12+
- main
13+
push:
14+
branches:
15+
- main
16+
schedule:
17+
- cron: '0 0 * * *' # Once a day at 12am UTC
18+
workflow_dispatch:
19+
20+
jobs:
21+
# ----------------------------------------------------------------------
22+
action_contexts:
23+
name: "Display GitHub Action Contexts"
24+
uses: davidbrownell/dbrownell_DevTools/.github/workflows/callable_display_action_contexts.yaml@main
25+
26+
# ----------------------------------------------------------------------
27+
validate:
28+
strategy:
29+
fail-fast: false
30+
31+
matrix:
32+
os:
33+
- macos-latest
34+
- ubuntu-latest
35+
- windows-latest
36+
37+
python_version:
38+
- "3.12"
39+
- "3.11"
40+
- "3.10"
41+
# - "3.9" # Not supported
42+
# - "3.8" # Not supported
43+
44+
name: Validate
45+
46+
uses: davidbrownell/dbrownell_DevTools/.github/workflows/callable_validate_python.yaml@main
47+
with:
48+
operating_system: ${{ matrix.os }}
49+
python_version: ${{ matrix.python_version }}
50+
51+
# ----------------------------------------------------------------------
52+
package_coverage:
53+
needs: validate
54+
55+
name: Postprocess Coverage Info
56+
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}
57+
58+
uses: davidbrownell/dbrownell_DevTools/.github/workflows/callable_package_python_coverage.yaml@main
59+
with:
60+
gist_id: 2f9d770d13e3a148424f374f74d41f4b
61+
gist_filename: PythonProjectBootstrapper_coverage.json
62+
secrets:
63+
GIST_TOKEN: ${{ secrets.GIST_TOKEN }}
64+
65+
# ----------------------------------------------------------------------
66+
create_package:
67+
needs: validate
68+
69+
strategy:
70+
fail-fast: false
71+
72+
matrix:
73+
os:
74+
- macos-latest
75+
- ubuntu-latest
76+
- windows-latest
77+
78+
python_version:
79+
- "3.12"
80+
- "3.11"
81+
- "3.10"
82+
# - "3.9" # Not supported
83+
# - "3.8" # Not supported
84+
85+
name: Create Package
86+
87+
uses: davidbrownell/dbrownell_DevTools/.github/workflows/callable_create_python_package.yaml@main
88+
with:
89+
operating_system: ${{ matrix.os }}
90+
python_version: ${{ matrix.python_version }}
91+
92+
# ----------------------------------------------------------------------
93+
validate_package:
94+
needs: create_package
95+
96+
strategy:
97+
fail-fast: false
98+
99+
matrix:
100+
os:
101+
- macos-latest
102+
- ubuntu-latest
103+
- windows-latest
104+
105+
python_version:
106+
- "3.12"
107+
- "3.11"
108+
- "3.10"
109+
# - "3.9" # Not supported
110+
# - "3.8" # Not supported
111+
112+
name: Validate Package
113+
114+
uses: davidbrownell/dbrownell_DevTools/.github/workflows/callable_validate_python_package.yaml@main
115+
with:
116+
operating_system: ${{ matrix.os }}
117+
python_version: ${{ matrix.python_version }}
118+
validation_command: python -c "from PythonProjectBootstrapper import __version__; print(__version__)"
119+
120+
# ----------------------------------------------------------------------
121+
create_binary:
122+
needs: validate
123+
124+
strategy:
125+
fail-fast: false
126+
127+
matrix:
128+
os:
129+
- macos-latest
130+
- ubuntu-latest
131+
- windows-latest
132+
133+
python_version:
134+
- "3.11"
135+
136+
name: Create Binary
137+
138+
uses: davidbrownell/dbrownell_DevTools/.github/workflows/callable_create_python_binary.yaml@main
139+
with:
140+
operating_system: ${{ matrix.os }}
141+
python_version: ${{ matrix.python_version }}
142+
143+
# ----------------------------------------------------------------------
144+
validate_binary:
145+
needs: create_binary
146+
147+
strategy:
148+
fail-fast: false
149+
150+
matrix:
151+
os:
152+
- macos-latest
153+
- ubuntu-latest
154+
- windows-latest
155+
156+
python_version:
157+
- "3.11"
158+
159+
name: Validate Binary
160+
161+
uses: davidbrownell/dbrownell_DevTools/.github/workflows/callable_validate_python_binary.yaml@main
162+
with:
163+
operating_system: ${{ matrix.os }}
164+
python_version: ${{ matrix.python_version }}
165+
validation_command: PythonProjectBootstrapper Version
166+
167+
# ----------------------------------------------------------------------
168+
publish:
169+
needs:
170+
- validate_package
171+
- validate_binary
172+
173+
name: Publish
174+
175+
uses: davidbrownell/dbrownell_DevTools/.github/workflows/callable_publish_python.yaml@main
176+
secrets:
177+
PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }}

.gitignore

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
Activate*.cmd
2+
Activate*.sh
3+
Deactivate*.cmd
4+
Deactivate*.sh
5+
6+
**/__pycache__/**
7+
**/Generated/**
8+
**/.coverage
9+
**/lcov.info
10+
**/.vscode
11+
12+
build/**
13+
dist/**
14+
src/PythonProjectBootstrapper.egg-info/**

Bootstrap.cmd

Lines changed: 114 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,114 @@
1+
@REM ----------------------------------------------------------------------
2+
@REM |
3+
@REM | This script downloads and invokes BoostrapImpl.cmd from the PythonBootstrapper
4+
@REM | repository (https://github.com/davidbrownell/PythonBootstrapper).
5+
@REM |
6+
@REM | Arguments:
7+
@REM |
8+
@REM | --debug Display additional debugging information.
9+
@REM |
10+
@REM | --force Ensure that a new python environment is installed, even if it already exists.
11+
@REM |
12+
@REM | --python-version <version> Specify the python version to install; the default python version is installed if not specified.
13+
@REM |
14+
@REM | --bootstrap-branch <branch> Specify the branch of the PythonBootstrapper repository to use when downloading BootstrapImpl; "main" is used if not specified.
15+
@REM |
16+
@REM ----------------------------------------------------------------------
17+
@setlocal EnableDelayedExpansion
18+
@pushd %~dp0
19+
20+
@REM ----------------------------------------------------------------------
21+
@REM |
22+
@REM | Parse and Process Arguments
23+
@REM |
24+
@REM ----------------------------------------------------------------------
25+
@set _BOOTSTRAP_BRANCH=main
26+
@set _COMMAND_LINE_ARGS=
27+
28+
:ParseArgs
29+
@if '%1' EQU '' @goto :ParseArgs_End
30+
31+
@set ARG=%1
32+
@set ARG=%ARG:"=%
33+
34+
@if "%ARG%" NEQ "--bootstrap-branch" @goto :ParseArgs_BootstrapBranchEnd
35+
36+
@REM Extract the bootstrap branch
37+
@shift /1
38+
39+
@set ARG=%1
40+
@set ARG=%ARG:"=%
41+
42+
@set _BOOTSTRAP_BRANCH=%ARG%
43+
@goto :ParseArgs_Next
44+
45+
:ParseArgs_BootstrapBranchEnd
46+
@set _COMMAND_LINE_ARGS=%_COMMAND_LINE_ARGS% %1
47+
48+
:ParseArgs_Next
49+
@shift /1
50+
@goto :ParseArgs
51+
52+
:ParseArgs_End
53+
54+
@REM ----------------------------------------------------------------------
55+
@REM |
56+
@REM | Download BootstrapImpl.cmd
57+
@REM |
58+
@REM ----------------------------------------------------------------------
59+
@echo Downloading Bootstrap code...
60+
61+
@set _BOOTSTRAPIMPL_URL=https://raw.githubusercontent.com/davidbrownell/PythonBootstrapper/%_BOOTSTRAP_BRANCH%/src/BootstrapImpl.cmd
62+
63+
@call :_CreateTempFileName
64+
65+
@curl --header "Cache-Control: no-cache, no-store" --header "Pragma: no-cache" --location %_BOOTSTRAPIMPL_URL% --output BootstrapImpl.cmd --no-progress-meter --fail-with-body > "%_BOOTSTRAP_TEMP_FILENAME%" 2>&1
66+
@set _ERRORLEVEL=%ERRORLEVEL%
67+
68+
@if %_ERRORLEVEL% NEQ 0 (
69+
@echo Downloading Bootstrap code...FAILED ^(%_BOOTSTRAPIMPL_URL%^).
70+
@echo.
71+
72+
@type "%_BOOTSTRAP_TEMP_FILENAME%"
73+
@goto :Exit
74+
)
75+
76+
@call :_DeleteTempFile
77+
@echo Downloading Bootstrap code...DONE.
78+
79+
@REM ----------------------------------------------------------------------
80+
@REM |
81+
@REM | Invoke BootstrapImpl.cmd
82+
@REM |
83+
@REM ----------------------------------------------------------------------
84+
@call BootstrapImpl.cmd %_COMMAND_LINE_ARGS%
85+
@set _ERRORLEVEL=%ERRORLEVEL%
86+
87+
@REM ----------------------------------------------------------------------
88+
@REM |
89+
@REM | Exit
90+
@REM |
91+
@REM ----------------------------------------------------------------------
92+
:Exit
93+
@if exist BootstrapImpl.cmd del BootstrapImpl.cmd
94+
@call :_DeleteTempFile
95+
96+
@popd
97+
98+
@endlocal & @exit /B %_ERRORLEVEL%
99+
100+
@REM ----------------------------------------------------------------------
101+
@REM ----------------------------------------------------------------------
102+
@REM ----------------------------------------------------------------------
103+
:_CreateTempFileName
104+
@set _BOOTSTRAP_TEMP_FILENAME=%CD%\Bootstrap-!RANDOM!-!Time:~6,5!
105+
@goto :EOF
106+
107+
@REM ----------------------------------------------------------------------
108+
:_DeleteTempFile
109+
@if "%_BOOTSTRAP_TEMP_FILENAME%" NEQ "" (
110+
@if exist "%_BOOTSTRAP_TEMP_FILENAME%" (
111+
@del "%_BOOTSTRAP_TEMP_FILENAME%"
112+
)
113+
)
114+
@goto :EOF

0 commit comments

Comments
 (0)