Skip to content

Commit

Permalink
Switch app workflows from ubuntu-latest to ubuntu-24.04 (#73)
Browse files Browse the repository at this point in the history
* Switch from ubuntu-latest to ubuntu-24.04
* Update jaxxstorm/action-install-gh-release to v1
* Whitespace fixes
  • Loading branch information
kkonstan authored Nov 13, 2024
1 parent f30bb82 commit ec853f3
Show file tree
Hide file tree
Showing 13 changed files with 33 additions and 53 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-latest
runs-on: ubuntu-24.04
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-latest
runs-on: ubuntu-24.04
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-latest
runs-on: ubuntu-24.04
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: 8 additions & 11 deletions .github/workflows/internal-version.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

name: increment-version

on:
Expand Down Expand Up @@ -27,25 +26,25 @@ on:
jobs:
increment-version:
name: increment-version
runs-on: ubuntu-latest
runs-on: ubuntu-24.04
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 @@ -59,7 +58,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 @@ -68,7 +67,6 @@ 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 @@ -100,4 +98,3 @@ jobs:
with:
tag: v${{ steps.setversion.outputs.patch }}
tag_exists_error: true

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


jobs:
exec:
name: '${{ inputs.command }} (${{ inputs.github_env }})'
runs-on: ubuntu-latest
runs-on: ubuntu-24.04
environment: ${{ inputs.github_env }}
env:
env_vars: ${{ secrets.env_vars }}
Expand Down Expand Up @@ -87,10 +86,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 @@ -146,7 +145,7 @@ jobs:
done
- name: Install iapc
uses: jaxxstorm/action-install-gh-release@v1.10.0
uses: jaxxstorm/action-install-gh-release@v1
with:
repo: cedws/iapc
tag: v0.1.9
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/p2p-get-latest-image-extended-test.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

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

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


jobs:
get-latest-image:
name: get-latest-image
runs-on: ubuntu-latest
runs-on: ubuntu-24.04
outputs:
version: ${{ steps.get-latest-image.outputs.version }}
environment: ${{ fromJson(inputs.environment).include[0]['deploy_env'] }}
Expand Down Expand Up @@ -84,6 +83,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: 5 additions & 7 deletions .github/workflows/p2p-promote-image.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,9 @@ on:
required: false
type: string


jobs:
lookup:
runs-on: ubuntu-latest
runs-on: ubuntu-24.04
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 @@ -68,7 +67,7 @@ jobs:
promote-image:
name: promote-to-${{ inputs.promotion-stage }}
runs-on: ubuntu-latest
runs-on: ubuntu-24.04
needs: [lookup]
environment: ${{ inputs.dest_github_env }}
env:
Expand Down Expand Up @@ -99,7 +98,7 @@ jobs:
yq -p=json -C <<EOT
${{ toJSON(env) }}
EOT
- name: Checkout
uses: actions/checkout@v4
with:
Expand Down Expand Up @@ -142,7 +141,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 @@ -171,7 +170,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 @@ -203,4 +202,3 @@ jobs:
DEST_ACCESS_TOKEN: ${{ steps.auth-dest.outputs.access_token }}
run: |
make p2p-promote-to-${{ inputs.promotion-stage }}
14 changes: 6 additions & 8 deletions .github/workflows/p2p-version.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,14 @@ on:
type: string
default: ''


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

steps:
- uses: actions/checkout@v4
with:
Expand All @@ -47,7 +46,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 @@ -59,8 +58,7 @@ 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 @@ -74,7 +72,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 @@ -110,7 +108,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: 1 addition & 2 deletions .github/workflows/p2p-workflow-extended-test.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

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

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

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

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


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

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


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

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


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


0 comments on commit ec853f3

Please sign in to comment.