ci: merge main to release (#8117)
This commit is contained in:
commit
d07ab123d4
59
.github/workflows/build.yml
vendored
59
.github/workflows/build.yml
vendored
|
@ -139,6 +139,7 @@ jobs:
|
||||||
needs: [prepare]
|
needs: [prepare]
|
||||||
with:
|
with:
|
||||||
ignoreLowerCoverage: ${{ github.event.inputs.ignoreLowerCoverage == 'true' }}
|
ignoreLowerCoverage: ${{ github.event.inputs.ignoreLowerCoverage == 'true' }}
|
||||||
|
skipSelenium: true
|
||||||
targetBaseVersion: ${{ needs.prepare.outputs.base_image_version }}
|
targetBaseVersion: ${{ needs.prepare.outputs.base_image_version }}
|
||||||
|
|
||||||
# -----------------------------------------------------------------
|
# -----------------------------------------------------------------
|
||||||
|
@ -157,6 +158,7 @@ jobs:
|
||||||
PKG_VERSION: ${{needs.prepare.outputs.pkg_version}}
|
PKG_VERSION: ${{needs.prepare.outputs.pkg_version}}
|
||||||
FROM_TAG: ${{needs.prepare.outputs.from_tag}}
|
FROM_TAG: ${{needs.prepare.outputs.from_tag}}
|
||||||
TO_TAG: ${{needs.prepare.outputs.to_tag}}
|
TO_TAG: ${{needs.prepare.outputs.to_tag}}
|
||||||
|
TARGET_BASE: ${{needs.prepare.outputs.base_image_version}}
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
|
@ -166,13 +168,15 @@ jobs:
|
||||||
|
|
||||||
- name: Launch build VM
|
- name: Launch build VM
|
||||||
id: azlaunch
|
id: azlaunch
|
||||||
|
timeout-minutes: 10
|
||||||
run: |
|
run: |
|
||||||
echo "Authenticating to Azure..."
|
echo "Authenticating to Azure..."
|
||||||
az login --service-principal -u ${{ secrets.AZ_BUILD_APP_ID }} -p ${{ secrets.AZ_BUILD_PWD }} --tenant ${{ secrets.AZ_BUILD_TENANT_ID }}
|
az login --service-principal -u ${{ secrets.AZ_BUILD_APP_ID }} -p ${{ secrets.AZ_BUILD_PWD }} --tenant ${{ secrets.AZ_BUILD_TENANT_ID }}
|
||||||
|
|
||||||
echo "Creating VM..."
|
echo "Creating VM..."
|
||||||
vminfo=$(az vm create \
|
vminfo=$(az vm create \
|
||||||
--resource-group ghaDatatracker \
|
--resource-group ghaDatatracker \
|
||||||
--name tmpGhaBuildVM \
|
--name tmpGhaBuildVM-${{ github.run_number }} \
|
||||||
--image Ubuntu2204 \
|
--image Ubuntu2204 \
|
||||||
--admin-username azureuser \
|
--admin-username azureuser \
|
||||||
--generate-ssh-keys \
|
--generate-ssh-keys \
|
||||||
|
@ -183,11 +187,19 @@ jobs:
|
||||||
--os-disk-size-gb 100 \
|
--os-disk-size-gb 100 \
|
||||||
--eviction-policy Delete \
|
--eviction-policy Delete \
|
||||||
--nic-delete-option Delete \
|
--nic-delete-option Delete \
|
||||||
|
--os-disk-delete-option Delete \
|
||||||
--output tsv \
|
--output tsv \
|
||||||
--query "publicIpAddress")
|
--query "publicIpAddress")
|
||||||
echo "ipaddr=$vminfo" >> "$GITHUB_OUTPUT"
|
echo "ipaddr=$vminfo" >> "$GITHUB_OUTPUT"
|
||||||
echo "VM Public IP: $vminfo"
|
echo "VM Public IP: $vminfo"
|
||||||
cat ~/.ssh/id_rsa > ${{ github.workspace }}/prvkey.key
|
cat ~/.ssh/id_rsa > ${{ github.workspace }}/prvkey.key
|
||||||
|
|
||||||
|
echo "Fetching SSH host public keys..."
|
||||||
|
until ssh-keyscan -t rsa $vminfo 2> /dev/null
|
||||||
|
do
|
||||||
|
echo "Will try again in 5 seconds..."
|
||||||
|
sleep 5
|
||||||
|
done
|
||||||
ssh-keyscan -t rsa $vminfo >> ~/.ssh/known_hosts
|
ssh-keyscan -t rsa $vminfo >> ~/.ssh/known_hosts
|
||||||
|
|
||||||
- name: Remote SSH into Build VM
|
- name: Remote SSH into Build VM
|
||||||
|
@ -207,7 +219,7 @@ jobs:
|
||||||
SKIP_TESTS: ${{ github.event.inputs.skiptests }}
|
SKIP_TESTS: ${{ github.event.inputs.skiptests }}
|
||||||
DEBIAN_FRONTEND: noninteractive
|
DEBIAN_FRONTEND: noninteractive
|
||||||
BROWSERSLIST_IGNORE_OLD_DATA: 1
|
BROWSERSLIST_IGNORE_OLD_DATA: 1
|
||||||
TARGETBASE: ${{ needs.prepare.outputs.base_image_version }}
|
TARGET_BASE: ${{ env.TARGET_BASE }}
|
||||||
with:
|
with:
|
||||||
host: ${{ steps.azlaunch.outputs.ipaddr }}
|
host: ${{ steps.azlaunch.outputs.ipaddr }}
|
||||||
port: 22
|
port: 22
|
||||||
|
@ -318,7 +330,8 @@ jobs:
|
||||||
echo "=========================================================================="
|
echo "=========================================================================="
|
||||||
echo "Collecting statics..."
|
echo "Collecting statics..."
|
||||||
echo "=========================================================================="
|
echo "=========================================================================="
|
||||||
sudo docker run --rm --name collectstatics -v $(pwd):/workspace ghcr.io/ietf-tools/datatracker-app-base:$TARGETBASE sh dev/build/collectstatics.sh
|
echo "Using ghcr.io/ietf-tools/datatracker-app-base:${{ env.TARGET_BASE }}"
|
||||||
|
sudo docker run --rm --name collectstatics -v $(pwd):/workspace ghcr.io/ietf-tools/datatracker-app-base:${{ env.TARGET_BASE }} sh dev/build/collectstatics.sh
|
||||||
echo "Pushing statics..."
|
echo "Pushing statics..."
|
||||||
cd static
|
cd static
|
||||||
aws s3 sync . s3://static/dt/$PKG_VERSION --only-show-errors
|
aws s3 sync . s3://static/dt/$PKG_VERSION --only-show-errors
|
||||||
|
@ -353,29 +366,29 @@ jobs:
|
||||||
shell: pwsh
|
shell: pwsh
|
||||||
run: |
|
run: |
|
||||||
echo "Destroying VM..."
|
echo "Destroying VM..."
|
||||||
az vm delete -g ghaDatatracker -n tmpGhaBuildVM --yes --force-deletion true
|
az vm delete -g ghaDatatracker -n tmpGhaBuildVM-${{ github.run_number }} --yes --force-deletion true
|
||||||
|
|
||||||
$resourceOrderRemovalOrder = [ordered]@{
|
# $resourceOrderRemovalOrder = [ordered]@{
|
||||||
"Microsoft.Compute/virtualMachines" = 0
|
# "Microsoft.Compute/virtualMachines" = 0
|
||||||
"Microsoft.Compute/disks" = 1
|
# "Microsoft.Compute/disks" = 1
|
||||||
"Microsoft.Network/networkInterfaces" = 2
|
# "Microsoft.Network/networkInterfaces" = 2
|
||||||
"Microsoft.Network/publicIpAddresses" = 3
|
# "Microsoft.Network/publicIpAddresses" = 3
|
||||||
"Microsoft.Network/networkSecurityGroups" = 4
|
# "Microsoft.Network/networkSecurityGroups" = 4
|
||||||
"Microsoft.Network/virtualNetworks" = 5
|
# "Microsoft.Network/virtualNetworks" = 5
|
||||||
}
|
# }
|
||||||
echo "Fetching remaining resources..."
|
# echo "Fetching remaining resources..."
|
||||||
$resources = az resource list --resource-group ghaDatatracker | ConvertFrom-Json
|
# $resources = az resource list --resource-group ghaDatatracker | ConvertFrom-Json
|
||||||
|
|
||||||
$orderedResources = $resources
|
# $orderedResources = $resources
|
||||||
| Sort-Object @{
|
# | Sort-Object @{
|
||||||
Expression = {$resourceOrderRemovalOrder[$_.type]}
|
# Expression = {$resourceOrderRemovalOrder[$_.type]}
|
||||||
Descending = $False
|
# Descending = $False
|
||||||
}
|
# }
|
||||||
|
|
||||||
echo "Deleting remaining resources..."
|
# echo "Deleting remaining resources..."
|
||||||
$orderedResources | ForEach-Object {
|
# $orderedResources | ForEach-Object {
|
||||||
az resource delete --resource-group ghaDatatracker --ids $_.id --verbose
|
# az resource delete --resource-group ghaDatatracker --ids $_.id --verbose
|
||||||
}
|
# }
|
||||||
|
|
||||||
echo "Logout from Azure..."
|
echo "Logout from Azure..."
|
||||||
az logout
|
az logout
|
||||||
|
|
9
.github/workflows/tests.yml
vendored
9
.github/workflows/tests.yml
vendored
|
@ -8,6 +8,11 @@ on:
|
||||||
default: false
|
default: false
|
||||||
required: true
|
required: true
|
||||||
type: boolean
|
type: boolean
|
||||||
|
skipSelenium:
|
||||||
|
description: 'Skip Selenium Tests'
|
||||||
|
default: false
|
||||||
|
required: true
|
||||||
|
type: boolean
|
||||||
targetBaseVersion:
|
targetBaseVersion:
|
||||||
description: 'Target Base Image Version'
|
description: 'Target Base Image Version'
|
||||||
default: latest
|
default: latest
|
||||||
|
@ -47,6 +52,10 @@ jobs:
|
||||||
echo "Model changes without migrations found."
|
echo "Model changes without migrations found."
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
if [[ "x${{ inputs.skipSelenium }}" == "xtrue" ]]; then
|
||||||
|
echo "Disable selenium tests..."
|
||||||
|
rm /usr/bin/geckodriver
|
||||||
|
fi
|
||||||
echo "Running tests..."
|
echo "Running tests..."
|
||||||
if [[ "x${{ inputs.ignoreLowerCoverage }}" == "xtrue" ]]; then
|
if [[ "x${{ inputs.ignoreLowerCoverage }}" == "xtrue" ]]; then
|
||||||
echo "Lower coverage failures will be ignored."
|
echo "Lower coverage failures will be ignored."
|
||||||
|
|
Loading…
Reference in a new issue