-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2 from act3-ace/1-clean-up-for-public-release
1 clean up for public release
- Loading branch information
Showing
23 changed files
with
357 additions
and
1,293 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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,21 +1,22 @@ | ||
// For format details, see https://aka.ms/devcontainer.json. For config options, see the | ||
// README at: https://github.com/devcontainers/templates/tree/main/src/docker-existing-dockerfile | ||
// README at: https://github.com/devcontainers/templates/tree/main/src/python | ||
{ | ||
"name": "Safe Autonomy Simulation Devcontainer", | ||
"image": "reg.git.act3-ace.com/rta/safe-autonomy-stack/safe-autonomy-simulation/development/develop:v1.0.0" | ||
|
||
// Features to add to the dev container. More info: https://containers.dev/features. | ||
// "features": {}, | ||
"name": "safe-autonomy-simulation devcontainer", | ||
// Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile | ||
"image": "mcr.microsoft.com/devcontainers/python:1-3.12-bullseye", | ||
"features": { | ||
"ghcr.io/devcontainers-contrib/features/poetry:2": {} | ||
}, | ||
|
||
// Use 'forwardPorts' to make a list of ports inside the container available locally. | ||
// "forwardPorts": [], | ||
|
||
// Uncomment the next line to run commands after the container is created. | ||
// "postCreateCommand": "cat /etc/os-release", | ||
// Use 'postCreateCommand' to run commands after the container is created. | ||
"postCreateCommand": "poetry install" | ||
|
||
// Configure tool-specific properties. | ||
// "customizations": {}, | ||
|
||
// Uncomment to connect as an existing user other than the container default. More info: https://aka.ms/dev-containers-non-root. | ||
// "remoteUser": "devcontainer" | ||
// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root. | ||
// "remoteUser": "root" | ||
} |
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,12 @@ | ||
# 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 more information: | ||
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates | ||
# https://containers.dev/guide/dependabot | ||
|
||
version: 2 | ||
updates: | ||
- package-ecosystem: "devcontainers" | ||
directory: "/" | ||
schedule: | ||
interval: weekly |
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,140 @@ | ||
name: build | ||
|
||
on: | ||
pull_request: | ||
push: | ||
branches: | ||
- "main" | ||
|
||
env: | ||
SRC_DIR: safe_autonomy_simulation | ||
PY_VER: "3.10" | ||
POETRY_VERSION: "1.8.3" | ||
|
||
jobs: | ||
lint: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Check out repository | ||
uses: actions/checkout@v4 | ||
- name: Setup Python | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: ${{ env.PY_VER }} | ||
- name: Install Poetry | ||
uses: snok/install-poetry@v1 | ||
with: | ||
version: ${{ env.POETRY_VERSION }} | ||
virtualenvs-create: false | ||
- name: Install Dependencies | ||
run: poetry install --no-interaction | ||
- name: Markdown Lint | ||
continue-on-error: true | ||
uses: articulate/actions-markdownlint@v1 | ||
- name: ISort | ||
continue-on-error: true | ||
run: isort --check --diff ${{ env.SRC_DIR }} | ||
- name: Yapf | ||
continue-on-error: true | ||
run: yapf --diff --recursive --parallel ${{ env.SRC_DIR }} | ||
- name: Mypy | ||
continue-on-error: true | ||
run: mypy ${{ env.SRC_DIR }} | ||
- name: Flake8 | ||
continue-on-error: true | ||
run: flake8 ${{ env.SRC_DIR }} | ||
- name: Pylint | ||
continue-on-error: true | ||
run: pylint ${{ env.SRC_DIR }} | ||
|
||
test: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Check out repository | ||
uses: actions/checkout@v4 | ||
- name: Setup Python | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: ${{ env.PY_VER }} | ||
- name: Install Poetry | ||
uses: snok/install-poetry@v1 | ||
with: | ||
version: ${{ env.POETRY_VERSION }} | ||
virtualenvs-create: false | ||
- name: Install Dependencies | ||
run: poetry install --no-interaction --no-root --with=test | ||
- name: Install Project | ||
run: poetry install --no-interaction --only-root | ||
- name: Run tests | ||
run: | | ||
pytest test --cov=${{ env.SRC_DIR }} | ||
- name: Package | ||
run: poetry build | ||
- name: Store Package | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: package-distributions | ||
path: dist/ | ||
release: | ||
runs-on: ubuntu-latest | ||
needs: [lint, test] | ||
if: ${{ github.ref_name != 'main' && needs.test.result == 'success' && !startsWith(github.event.head_commit.message, 'chore(release):') }} | ||
permissions: | ||
contents: write | ||
steps: | ||
- name: Check out repository | ||
uses: actions/checkout@v4 | ||
- name: Setup Python | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: ${{ env.PY_VER }} | ||
- name: Install Poetry | ||
uses: snok/install-poetry@v1 | ||
with: | ||
version: ${{ env.POETRY_VERSION }} | ||
virtualenvs-create: false | ||
- name: Semantic Release | ||
uses: cycjimmy/semantic-release-action@v4 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
extra_plugins: | | ||
@semantic-release/commit-analyzer | ||
@semantic-release/release-notes-generator | ||
@semantic-release/changelog | ||
@semantic-release/exec | ||
@semantic-release/git | ||
release-main: | ||
runs-on: ubuntu-latest | ||
needs: [lint, test] | ||
if: ${{ github.ref_name == 'main' && needs.test.result == 'success' && !startsWith(github.event.head_commit.message, 'chore(release):') }} | ||
environment: | ||
name: release | ||
permissions: | ||
contents: write | ||
steps: | ||
- name: Check out repository | ||
uses: actions/checkout@v4 | ||
with: | ||
persist-credentials: false | ||
- name: Setup Python | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: ${{ env.PY_VER }} | ||
- name: Install Poetry | ||
uses: snok/install-poetry@v1 | ||
with: | ||
version: ${{ env.POETRY_VERSION }} | ||
virtualenvs-create: false | ||
- name: Semantic Release | ||
uses: cycjimmy/semantic-release-action@v4 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.RELEASE_TOKEN }} | ||
with: | ||
extra_plugins: | | ||
@semantic-release/commit-analyzer | ||
@semantic-release/release-notes-generator | ||
@semantic-release/changelog | ||
@semantic-release/exec | ||
@semantic-release/git | ||
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: Release | ||
|
||
on: | ||
workflow_run: | ||
workflows: [build] | ||
branches: [main] | ||
types: | ||
- completed | ||
|
||
jobs: | ||
github-release: | ||
runs-on: ubuntu-latest | ||
if: ${{ github.event.workflow_run.conclusion == 'success' && github.event.workflow_run.event == 'push' && startsWith(github.event.workflow_run.head_commit.message, 'chore(release):') }} | ||
environment: | ||
name: release | ||
permissions: | ||
contents: write | ||
id-token: write | ||
steps: | ||
- name: Check out repository | ||
uses: actions/checkout@v4 | ||
- name: Download all the dists | ||
uses: actions/download-artifact@v4 | ||
with: | ||
run-id: ${{ github.event.workflow_run.id }} | ||
name: package-distributions | ||
github-token: ${{ secrets.RELEASE_TOKEN }} | ||
path: dist/ | ||
- name: Sign the dists | ||
uses: sigstore/[email protected] | ||
with: | ||
upload-signing-artifacts: true | ||
inputs: >- | ||
./dist/*.tar.gz | ||
./dist/*.whl | ||
- name: Get Version | ||
id: ver | ||
run: echo "version=$(cat VERSION)" >> $GITHUB_OUTPUT | ||
- name: Create Github Release | ||
env: | ||
GITHUB_TOKEN: ${{ github.token }} | ||
run: >- | ||
gh release create | ||
v${{ steps.ver.outputs.version }} | ||
-t ${{ steps.ver.outputs.version }} | ||
--repo '${{ github.repository }}' | ||
--notes-file ./CHANGELOG.md | ||
dist/** | ||
publish-to-pypi: | ||
name: Publish Python distribution to PyPI | ||
runs-on: ubuntu-latest | ||
if: ${{ github.event.workflow_run.conclusion == 'success' && github.event.workflow_run.event == 'push' && startsWith(github.event.workflow_run.head_commit.message, 'chore(release):') }} | ||
environment: | ||
name: release | ||
url: https://pypi.org/p/safe-autonomy-simulation | ||
permissions: | ||
id-token: write | ||
steps: | ||
- name: Download all the dists | ||
uses: actions/download-artifact@v4 | ||
with: | ||
run-id: ${{ github.event.workflow_run.id }} | ||
name: package-distributions | ||
github-token: ${{ secrets.RELEASE_TOKEN }} | ||
path: dist/ | ||
- name: Publish to PyPI | ||
uses: pypa/[email protected] |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.