Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updates for continued support #64

Open
wants to merge 19 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 6 additions & 28 deletions .devcontainer/createorupdate.ps1
Original file line number Diff line number Diff line change
@@ -1,21 +1,11 @@
#!/usr/bin/env pwsh
# Runs post create commands to prep Codespace for project

# Update relevant packages
# Get latest package information
sudo apt-get update
#sudo apt-get install --only-upgrade -y azure-cli powershell
if (!(Get-Command func -ErrorAction SilentlyContinue)) {
sudo apt-get install -y azure-functions-core-tools
}
if (!(Get-Content /etc/apt/sources.list | Select-String "^deb.*hashicorp" )) {
sudo apt-get install -y lsb-release
curl -fsSL https://apt.releases.hashicorp.com/gpg | sudo apt-key add -
sudo apt-add-repository "deb [arch=amd64] https://apt.releases.hashicorp.com $(lsb_release -cs) main"
sudo apt-get install -y terraform
}
if (!(Get-Command tmux -ErrorAction SilentlyContinue)) {
sudo apt-get install -y tmux
}

# Install tfenv dependencies
sudo apt-get install -y tmux

# Determine directory locations (may vary based on what branch has been cloned initially)
$repoDirectory = (Split-Path $PSScriptRoot -Parent)
Expand All @@ -28,7 +18,8 @@ if (!(Get-Command tfenv -ErrorAction SilentlyContinue)) {
Write-Host 'Installing tfenv...'
git clone https://github.com/tfutils/tfenv.git ~/.tfenv
sudo ln -s ~/.tfenv/bin/* /usr/local/bin
} else {
}
else {
Write-Host 'Upgrading tfenv...'
git -C ~/.tfenv pull
}
Expand All @@ -42,19 +33,6 @@ tfenv use latest
terraform init -upgrade
Pop-Location

# Use geekzter/bootstrap-os for PowerShell setup
if (Test-Path ~/bootstrap-os) {
# This has been run before, upgrade packages
sudo apt-get upgrade -y
} else {
git clone https://github.com/geekzter/bootstrap-os.git ~/bootstrap-os
}
Push-Location ~/bootstrap-os/linux
./bootstrap_linux.sh --skip-packages
Pop-Location
. ~/bootstrap-os/common/functions/functions.ps1
AddorUpdateModule Posh-Git

# Link PowerShell Profile
if (!(Test-Path $Profile)) {
New-Item -ItemType symboliclink -Path $Profile -Target $profileTemplate -Force | Select-Object -ExpandProperty Name
Expand Down
30 changes: 15 additions & 15 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
{
"features": {
"ghcr.io/devcontainers/features/azure-cli:1": {},
"ghcr.io/jlaundry/devcontainer-features/azure-functions-core-tools:1": {},
"ghcr.io/devcontainers/features/dotnet:2": {},
"ghcr.io/devcontainers/features/powershell:1": {},
"ghcr.io/devcontainers/features/terraform:1": {}
},
// Install extensions
"extensions": [
"4ops.terraform",
"ms-azuretools.vscode-azurefunctions",
"ms-azuretools.vscode-azureterraform",
"ms-dotnettools.csharp",
"ms-vscode.azurecli",
"ms-vscode.PowerShell"
],

// VSCode settings
"settings": {
// "terminal.integrated.cwd": "/home/codespace/workspace,
"terminal.integrated.shell.linux": "/usr/bin/pwsh"
"customizations": {
"vscode": {
"settings": {
// "terminal.integrated.cwd": "/home/codespace/workspace,
"terminal.integrated.shell.linux": "/usr/bin/pwsh"
}
}
},

// Run bash script in .devcontainer directory
"postCreateCommand": "/usr/bin/pwsh -nop -f ./.devcontainer/createorupdate.ps1 > ~/post-create.log"
}
}
2 changes: 1 addition & 1 deletion .devcontainer/profile.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ $scriptDirectory = (Join-Path $repoDirectory "scripts")
[System.Collections.ArrayList]$pathList = $env:PATH.Split(":")
# Insert script path into PATH, so scripts can be called from anywhere
if (!$pathList.Contains($scriptDirectory)) {
$pathList.Insert(1,$scriptDirectory)
$pathList.Insert(1, $scriptDirectory)
}
$env:PATH = $pathList -Join ":"

Expand Down
58 changes: 27 additions & 31 deletions .github/workflows/ci-dotnet.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,50 +3,46 @@ name: ci-dotnet
on:
push:
branches:
- '**'
- "**"
paths:
- '.github/workflows/ci-function.yml'
- 'functions/**'
- ".github/workflows/ci-function.yml"
- "functions/**"
pull_request:
branches: [ main ]
branches: [main]
paths-ignore:
- '**/README.md'
- '**/LICENSE'
- 'visuals/**'
- "**/README.md"
- "**/LICENSE"
- "visuals/**"

schedule:
- cron: '0 2 * * *'
- cron: "0 2 * * *"

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

env:
AZURE_FUNCTIONAPP_PACKAGE_PATH: './functions'
DOTNET_VERSION: '6.0.x'
AZURE_FUNCTIONAPP_PACKAGE_PATH: "./functions"

jobs:
dotnet:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- name: Setup .NET
uses: actions/setup-dotnet@v1
with:
dotnet-version: ${{ env.DOTNET_VERSION }}
- name: Restore dependencies
run: |
pushd './${{ env.AZURE_FUNCTIONAPP_PACKAGE_PATH }}'
dotnet restore
popd
- name: Build
run: |
pushd './${{ env.AZURE_FUNCTIONAPP_PACKAGE_PATH }}'
dotnet build --no-restore --output ./bin/publish
popd
- name: Test
run: |
pushd './${{ env.AZURE_FUNCTIONAPP_PACKAGE_PATH }}'
dotnet test --no-build --verbosity normal
popd
- uses: actions/checkout@v4
- name: Setup .NET
uses: actions/setup-dotnet@v4
- name: Restore dependencies
run: |
pushd './${{ env.AZURE_FUNCTIONAPP_PACKAGE_PATH }}'
dotnet restore
popd
- name: Build
run: |
pushd './${{ env.AZURE_FUNCTIONAPP_PACKAGE_PATH }}'
dotnet build --no-restore --output ./bin/publish
popd
- name: Test
run: |
pushd './${{ env.AZURE_FUNCTIONAPP_PACKAGE_PATH }}'
dotnet test --no-build --verbosity normal
popd
11 changes: 3 additions & 8 deletions .github/workflows/ci-scripted-strategy.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,6 @@
{
"os": [
"ubuntu-latest"
],
"compatible": [
"backward",
"forward"
],
"os": ["ubuntu-latest"],
"compatible": ["backward", "forward"],
"include": [
{
"name": "a",
Expand All @@ -30,4 +25,4 @@
"upgrade_azure_cli": true
}
]
}
}
Loading