Skip to content

Commit

Permalink
Revert "Switch app workflows from ubuntu-latest to ubuntu-24.04 (#73)"
Browse files Browse the repository at this point in the history
This reverts commit ec853f3.
  • Loading branch information
kkonstan authored Nov 13, 2024
1 parent ec853f3 commit 5ca3be2
Show file tree
Hide file tree
Showing 13 changed files with 53 additions and 33 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/bump-version.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
git-token: ${{ secrets.GITHUB_TOKEN }}

fail:
runs-on: ubuntu-24.04
runs-on: ubuntu-latest
if: github.event.action == 'failure'
steps:
- name: Exit with error
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/internal-cd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
generate-minor: false

trigger-p2p-build:
runs-on: ubuntu-24.04
runs-on: ubuntu-latest
needs: [internal-version]
env:
ACCESS_TOKEN: ${{ secrets.ACCESS_TOKEN }}
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/internal-ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
dry-run: true

print-version:
runs-on: ubuntu-24.04
runs-on: ubuntu-latest
needs: increment-version
steps:
- env:
Expand All @@ -36,7 +36,7 @@ jobs:
with:
dry-run: true
uses: ./.github/workflows/p2p-version.yaml

test_execute_command:
needs: [test_version]
uses: ./.github/workflows/p2p-execute-command.yaml
Expand Down Expand Up @@ -70,7 +70,7 @@ jobs:

test_extended_test:
uses: ./.github/workflows/p2p-workflow-extended-test.yaml
needs: [get_image_extended_test]
needs: [get_image_extended_test]
secrets:
env_vars: |
TEST_VARIABLE=value
Expand Down
19 changes: 11 additions & 8 deletions .github/workflows/internal-version.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@

name: increment-version

on:
Expand Down Expand Up @@ -26,25 +27,25 @@ on:
jobs:
increment-version:
name: increment-version
runs-on: ubuntu-24.04
runs-on: ubuntu-latest
outputs:
version: ${{ steps.setversion.outputs.patch }}

steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
fetch-depth: 0
- name: Configure Git
run: |
git config user.name "$GITHUB_ACTOR"
git config user.email "[email protected]"
git config user.email "[email protected]"
- name: Get Previous tag
id: previoustag
shell: bash
run: |
git tag | sort -r --version-sort | head -n1
echo "tag=$(git tag | sort -r --version-sort | head -n1)" >> "$GITHUB_OUTPUT"
git tag | sort -r --version-sort | head -n1
echo "tag=$(git tag | sort -r --version-sort | head -n1)" >> "$GITHUB_OUTPUT"
env:
GITHUB_TOKEN: ${{ secrets.git-token }}

Expand All @@ -58,7 +59,7 @@ jobs:
id: semvers
uses: "WyriHaximus/github-action-next-semvers@v1"
with:
version: ${{ inputs.override != '' && inputs.override || steps.previousversion.outputs.version }}
version: ${{ inputs.override != '' && inputs.override || steps.previousversion.outputs.version }}

- name: Set bumped version in output
id: setversion
Expand All @@ -67,6 +68,7 @@ jobs:
echo "patch=${{ steps.semvers.outputs.patch }}" >> "$GITHUB_OUTPUT"
echo "minor=${{ steps.semvers.outputs.patch }}" | cut -d. -f1,2 >> "$GITHUB_OUTPUT"
echo "major=${{ steps.semvers.outputs.patch }}" | cut -d. -f1 >> "$GITHUB_OUTPUT"
- name: Show the tags
shell: bash
Expand Down Expand Up @@ -98,3 +100,4 @@ jobs:
with:
tag: v${{ steps.setversion.outputs.patch }}
tag_exists_error: true

9 changes: 5 additions & 4 deletions .github/workflows/p2p-execute-command.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,11 @@ on:
type: string
default: '.'


jobs:
exec:
name: '${{ inputs.command }} (${{ inputs.github_env }})'
runs-on: ubuntu-24.04
runs-on: ubuntu-latest
environment: ${{ inputs.github_env }}
env:
env_vars: ${{ secrets.env_vars }}
Expand Down Expand Up @@ -86,10 +87,10 @@ jobs:
if: ${{ inputs.optional == true }}
working-directory: ${{ inputs.working-directory }}
id: is_optional
run: |
run: |
declare -r optional_target=${{ inputs.command }}
# match target in format: `.PHONY: <target_name>`, skip if commented out
if grep "^[^#]*.PHONY.*${optional_target}.*" ./Makefile; then
if grep "^[^#]*.PHONY.*${optional_target}.*" ./Makefile; then
echo "SKIP=false" >> $GITHUB_ENV
else
echo "WARNING: No Makefile target [$optional_target], skipping job"
Expand Down Expand Up @@ -145,7 +146,7 @@ jobs:
done
- name: Install iapc
uses: jaxxstorm/action-install-gh-release@v1
uses: jaxxstorm/action-install-gh-release@v1.10.0
with:
repo: cedws/iapc
tag: v0.1.9
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/p2p-get-latest-image-extended-test.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@

on:
workflow_call:
secrets:
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/p2p-get-latest-image-prod.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@

on:
workflow_call:
secrets:
Expand Down
5 changes: 3 additions & 2 deletions .github/workflows/p2p-get-latest-image.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,11 @@ on:
required: true
type: string


jobs:
get-latest-image:
name: get-latest-image
runs-on: ubuntu-24.04
runs-on: ubuntu-latest
outputs:
version: ${{ steps.get-latest-image.outputs.version }}
environment: ${{ fromJson(inputs.environment).include[0]['deploy_env'] }}
Expand Down Expand Up @@ -83,6 +84,6 @@ jobs:
working-directory: ${{ inputs.working-directory }}
run: |
[ $DRY_RUN == false ] && version=$(gcloud container images list-tags ${REGISTRY}/${REGISTRY_PATH}/${IMAGE_NAME} --limit=1 --format=json )
[ $? -gt 0 ] && [ $DRY_RUN == false ] && echo "exiting" && exit 1
[ $? -gt 0 ] && [ $DRY_RUN == false ] && echo "exiting" && exit 1
[ $DRY_RUN == true ] && version="[{\"tags\": [\"0.0.0\"]}]"
echo "version=$(echo ${version} | jq -r '.[0].tags[0]')" >> "$GITHUB_OUTPUT"
12 changes: 7 additions & 5 deletions .github/workflows/p2p-promote-image.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,10 @@ on:
required: false
type: string


jobs:
lookup:
runs-on: ubuntu-24.04
runs-on: ubuntu-latest
environment: ${{ fromJson(inputs.source_matrix).include[0]['deploy_env'] }}
env:
REGISTRY: ${{ inputs.region }}-docker.pkg.dev/${{ vars.PROJECT_ID }}/tenant/${{ vars.TENANT_NAME }}
Expand All @@ -67,7 +68,7 @@ jobs:
promote-image:
name: promote-to-${{ inputs.promotion-stage }}
runs-on: ubuntu-24.04
runs-on: ubuntu-latest
needs: [lookup]
environment: ${{ inputs.dest_github_env }}
env:
Expand Down Expand Up @@ -98,7 +99,7 @@ jobs:
yq -p=json -C <<EOT
${{ toJSON(env) }}
EOT
- name: Checkout
uses: actions/checkout@v4
with:
Expand Down Expand Up @@ -141,7 +142,7 @@ jobs:
uses: google-github-actions/setup-gcloud@v2
with:
install_components: beta,gke-gcloud-auth-plugin

- name: Setup kubeconfig
id: setup-kubeconfig
if: inputs.dry-run == false && inputs.connect-to-k8s == true
Expand Down Expand Up @@ -170,7 +171,7 @@ jobs:
chmod +x corectl
sudo mv corectl /usr/local/bin/
rm corectl.tar.gz
corectl help
- name: Decode environment variables
Expand Down Expand Up @@ -202,3 +203,4 @@ jobs:
DEST_ACCESS_TOKEN: ${{ steps.auth-dest.outputs.access_token }}
run: |
make p2p-promote-to-${{ inputs.promotion-stage }}
14 changes: 8 additions & 6 deletions .github/workflows/p2p-version.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,15 @@ on:
type: string
default: ''


jobs:
increment-version:
name: increment-version
runs-on: ubuntu-24.04
runs-on: ubuntu-latest
outputs:
version: ${{ steps.setversion.outputs.version }}
previous_version: ${{ steps.setversion.outputs.previous_version }}

steps:
- uses: actions/checkout@v4
with:
Expand All @@ -46,7 +47,7 @@ jobs:
- name: Configure Git
run: |
git config user.name "$GITHUB_ACTOR"
git config user.email "[email protected]"
git config user.email "[email protected]"
- name: Get Previous tag
id: previoustag
Expand All @@ -58,7 +59,8 @@ jobs:
REGEX=$(echo "^${VERSION_PREFIX}([0-9]+)\.([0-9]+)\.([0-9]+)$")
PREVIOUS_VERSION=$(git tag | sort -r --version-sort | (grep -E ${REGEX} || echo "") | head -n1 )
[ -z "$PREVIOUS_VERSION" ] && PREVIOUS_VERSION=${VERSION_PREFIX}0.0.0
echo "tag=$PREVIOUS_VERSION" >> "$GITHUB_OUTPUT"
echo "tag=$PREVIOUS_VERSION" >> "$GITHUB_OUTPUT"
- name: get previous version from tag
id: previousversion
Expand All @@ -72,7 +74,7 @@ jobs:
id: semvers
uses: "WyriHaximus/github-action-next-semvers@v1"
with:
version: ${{ steps.previousversion.outputs.version }}
version: ${{ steps.previousversion.outputs.version }}

- name: get git hashes
id: githashes
Expand Down Expand Up @@ -108,7 +110,7 @@ jobs:
TAG=${{ steps.semvers.outputs.patch }}
PREVIOUS_TAG=${{ steps.previousversion.outputs.version }}
HASH=${{ steps.githashes.outputs.current_hash }}
LAST_TAG_HASH=${{ steps.githashes.outputs.previous_tag_hash }}

Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/p2p-workflow-extended-test.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@

on:
workflow_call:
secrets:
Expand Down Expand Up @@ -40,7 +41,7 @@ on:
type: string

env:
REGION: ${{ inputs.region }}
REGION: ${{ inputs.region }}

jobs:
run-tests:
Expand Down
8 changes: 6 additions & 2 deletions .github/workflows/p2p-workflow-fastfeedback.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@

on:
workflow_call:
secrets:
Expand All @@ -16,7 +17,7 @@ on:
required: false
type: string
default: ''
version:
version:
required: true
type: string
region:
Expand All @@ -42,8 +43,9 @@ on:
version:
value: ${{ inputs.version }}


env:
REGION: ${{ inputs.region }}
REGION: ${{ inputs.region }}

jobs:
build:
Expand Down Expand Up @@ -130,3 +132,5 @@ jobs:
working-directory: ${{ inputs.working-directory }}
connect-to-k8s: true
corectl-version: ${{ inputs.corectl-version }}


4 changes: 4 additions & 0 deletions .github/workflows/p2p-workflow-prod.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@

on:
workflow_call:
secrets:
Expand Down Expand Up @@ -29,6 +30,7 @@ on:
type: string
default: 'v'


jobs:
prod-deploy:
name: prod-deploy
Expand All @@ -46,3 +48,5 @@ jobs:
dry-run: ${{ inputs.dry-run }}
working-directory: ${{ inputs.working-directory }}
checkout-version: ${{ inputs.version-prefix }}${{ inputs.version }}


0 comments on commit 5ca3be2

Please sign in to comment.