Skip to content

Commit

Permalink
Add minimal config for Codespaces (#4406)
Browse files Browse the repository at this point in the history
Make it easier to use Codespace to develop rspec-tools by reusing the Dockerfile for the CI.
  • Loading branch information
marco-antognini-sonarsource authored Oct 11, 2024
1 parent 8dfa2ff commit b16a5e7
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 3 deletions.
4 changes: 1 addition & 3 deletions .cirrus.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,7 @@ tooling_tests_task:
env:
PYTHONPATH: .
install_dependencies_script:
- cd rspec-tools
- pipenv install --dev
- pipenv run pip install pytest pytest-cov
- ci/install_rspec_tools_dependencies.sh
tests_script:
- bash ci/fetch_branches.sh
- cd rspec-tools
Expand Down
16 changes: 16 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"build": {
"dockerfile": "../ci/Dockerfile"
},
// https://code.visualstudio.com/docs/devcontainers/create-dev-container#_rebuild
"postCreateCommand": ".devcontainer/finalize-container.sh",
"waitFor": "postCreateCommand",
"customizations": {
"vscode": {
"extensions": [
"ms-python.python",
"asciidoctor.asciidoctor-vscode"
]
}
}
}
7 changes: 7 additions & 0 deletions .devcontainer/finalize-container.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/usr/bin/env bash

set -euo pipefail

TOP_DIR=$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" &> /dev/null && pwd)/..

$TOP_DIR/ci/install_rspec_tools_dependencies.sh
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
# generated files
/rules/**/*.html
/frontend/public/rules
rspec-tools/link_probes.history

# compiled files
*.out
Expand Down
7 changes: 7 additions & 0 deletions ci/install_rspec_tools_dependencies.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/usr/bin/env bash

set -euo pipefail

cd rspec-tools
pipenv install --dev
pipenv run pip install pytest pytest-cov

0 comments on commit b16a5e7

Please sign in to comment.