Skip to content

Commit

Permalink
feat: improve devenv setup and ci for test (#163)
Browse files Browse the repository at this point in the history
# 📥 Pull Request

## ❓ What are you trying to address

This pull request includes updates to the
`.devcontainer/devcontainer.json` and significant modifications to the
`.github/workflows/test.yml` file to streamline the CI/CD process and
ensure proper environment setup.

## ✨ Description of new changes


### Updates to `.devcontainer/devcontainer.json`:
* Updated the Terraform version from `1.10.2` to `1.10.3` to ensure the
latest features and fixes are included.
* Added a command to change ownership of the PowerShell directory to the
`vscode` user after the container is created.
* Changed the path for `pwsh` and set
`powershell.powerShellDefaultVersion` to `pwsh`.
* Added the `ms-azuretools.vscode-azure-github-copilot` extension to the
list of recommended extensions.

### Modifications to `.github/workflows/test.yml`:
* Reorganized jobs to ensure that the `changes` job runs first and
subsequent jobs depend on its output, improving efficiency by only
running tests if there are relevant changes.
[[1]](diffhunk://#diff-faff1af3d8ff408964a57b2e475f69a6b7c7b71c9978cccc8f471798caac2c88L34-R44)
[[2]](diffhunk://#diff-faff1af3d8ff408964a57b2e475f69a6b7c7b71c9978cccc8f471798caac2c88R53-R101)
* Removed redundant `if` conditions that checked for changes,
simplifying the workflow and reducing unnecessary checks.
[[1]](diffhunk://#diff-faff1af3d8ff408964a57b2e475f69a6b7c7b71c9978cccc8f471798caac2c88L105-R110)
[[2]](diffhunk://#diff-faff1af3d8ff408964a57b2e475f69a6b7c7b71c9978cccc8f471798caac2c88L136-R184)
[[3]](diffhunk://#diff-faff1af3d8ff408964a57b2e475f69a6b7c7b71c9978cccc8f471798caac2c88L190-L231)
[[4]](diffhunk://#diff-faff1af3d8ff408964a57b2e475f69a6b7c7b71c9978cccc8f471798caac2c88L241-L253)
[[5]](diffhunk://#diff-faff1af3d8ff408964a57b2e475f69a6b7c7b71c9978cccc8f471798caac2c88L270)
[[6]](diffhunk://#diff-faff1af3d8ff408964a57b2e475f69a6b7c7b71c9978cccc8f471798caac2c88L321-R305)
[[7]](diffhunk://#diff-faff1af3d8ff408964a57b2e475f69a6b7c7b71c9978cccc8f471798caac2c88L332-L333)
[[8]](diffhunk://#diff-faff1af3d8ff408964a57b2e475f69a6b7c7b71c9978cccc8f471798caac2c88L352-R360)
[[9]](diffhunk://#diff-faff1af3d8ff408964a57b2e475f69a6b7c7b71c9978cccc8f471798caac2c88L400-R386)
[[10]](diffhunk://#diff-faff1af3d8ff408964a57b2e475f69a6b7c7b71c9978cccc8f471798caac2c88L430-R396)
[[11]](diffhunk://#diff-faff1af3d8ff408964a57b2e475f69a6b7c7b71c9978cccc8f471798caac2c88L439-R405)
[[12]](diffhunk://#diff-faff1af3d8ff408964a57b2e475f69a6b7c7b71c9978cccc8f471798caac2c88L448-R414)
[[13]](diffhunk://#diff-faff1af3d8ff408964a57b2e475f69a6b7c7b71c9978cccc8f471798caac2c88L462-R436)
[[14]](diffhunk://#diff-faff1af3d8ff408964a57b2e475f69a6b7c7b71c9978cccc8f471798caac2c88L484-R450)
[[15]](diffhunk://#diff-faff1af3d8ff408964a57b2e475f69a6b7c7b71c9978cccc8f471798caac2c88L494-R464)
* Ensured that the `coverage-summary` job runs only if there are
relevant changes, improving the efficiency of the CI/CD pipeline.
* Updated the `checkout` and `setup-go` actions to use specific commit
hashes for better reliability and reproducibility.
[[1]](diffhunk://#diff-faff1af3d8ff408964a57b2e475f69a6b7c7b71c9978cccc8f471798caac2c88L190-L231)
[[2]](diffhunk://#diff-faff1af3d8ff408964a57b2e475f69a6b7c7b71c9978cccc8f471798caac2c88L270)
  • Loading branch information
DariuszPorowski authored Dec 20, 2024
1 parent 14244d5 commit 258ee38
Show file tree
Hide file tree
Showing 4 changed files with 144 additions and 104 deletions.
11 changes: 7 additions & 4 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
// "ghcr.io/guiyomh/features/gomarkdoc:0": {},
// "ghcr.io/guiyomh/features/gotestsum:0": {},
"ghcr.io/devcontainers/features/terraform:1": {
"version": "1.10.2",
"version": "1.10.3",
"installSentinel": true,
"installTFsec": true,
"installTerraformDocs": true
Expand All @@ -61,7 +61,8 @@
},
// Use 'postCreateCommand' to run commands after the container is created.
"postCreateCommand": {
"git-safe-dir": "git config --global --add safe.directory ${containerWorkspaceFolder}"
"git-safe-dir": "git config --global --add safe.directory ${containerWorkspaceFolder}",
"pwsh-chown": "sudo chown -R vscode:vscode /home/vscode/.local/share/powershell"
},
// "privileged": true,
"remoteUser": "vscode",
Expand All @@ -86,8 +87,9 @@
"terminal.integrated.defaultProfile.linux": "zsh",
"terminal.integrated.defaultProfile.osx": "zsh",
"powershell.powerShellAdditionalExePaths": {
"pwsh": "/usr/local/bin/pwsh"
}
"pwsh": "/usr/bin/pwsh"
},
"powershell.powerShellDefaultVersion": "pwsh"
},
"extensions": [
"golang.go",
Expand All @@ -109,6 +111,7 @@
"darkriszty.markdown-table-prettify",
"TakumiI.markdowntable",
"hashicorp.terraform",
"ms-azuretools.vscode-azure-github-copilot",
"ms-azuretools.vscode-azureterraform",
"ms-azuretools.vscode-docker",
"ms-vscode-remote.vscode-remote-extensionpack",
Expand Down
Loading

0 comments on commit 258ee38

Please sign in to comment.