Skip to content

Commit

Permalink
Merge pull request #1598 from mkrnr/update-gh-actions-set-output-command
Browse files Browse the repository at this point in the history
Update commands and OS versions in GitHub Actions
  • Loading branch information
sammdot committed Jul 14, 2023
2 parents 32489ae + 29878f8 commit d5386f8
Show file tree
Hide file tree
Showing 6 changed files with 102 additions and 100 deletions.
162 changes: 81 additions & 81 deletions .github/workflows/ci.yml

Large diffs are not rendered by default.

18 changes: 9 additions & 9 deletions .github/workflows/ci/helpers.sh
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ setup_cache_name()
[ "$target_python" = "${py_installer_version%.*}" ] || die 1 "versions mismatch: target=$target_python, installer=$py_installer_version"
target_python="$py_installer_version"
fi
"$python" - "$GITHUB_JOB" "$target_python" "$platform_name" <<\EOF
cache_name=$("$python" - "$GITHUB_JOB" "$target_python" "$platform_name" <<\EOF
import platform
import re
import sys
Expand All @@ -57,9 +57,9 @@ else:
assert parts == python_version.split('.')[:len(parts)], \
'versions mismatch: expected=%s, actual=%s' % (target_python, python_version)
cache_name = '%s_py-%s_%s' % (name, python_version, platform_name)
print('::set-output name=cache_name::' + cache_name)
EOF
print(f'{name}_py-{python_version}_{platform_name}')
EOF)
echo "cache_name=$cache_name" >> $GITHUB_OUTPUT
}
setup_osx_python()
Expand Down Expand Up @@ -246,9 +246,9 @@ analyze_set_release_info()
skip_release='yes'
fi
info "Skip Release? $skip_release ($release_type)"
echo "::set-output name=is_release::$is_release"
echo "::set-output name=release_type::$release_type"
echo "::set-output name=release_skip_job::$skip_release"
echo "is_release=$is_release" >> $GITHUB_OUTPUT
echo "release_type=$release_type" >> $GITHUB_OUTPUT
echo "release_skip_job=$skip_release" >> $GITHUB_OUTPUT
}
analyze_set_job_skip_cache_key()
Expand All @@ -260,7 +260,7 @@ analyze_set_job_skip_cache_key()
skiplists+=(".github/workflows/ci/skiplist_$list.txt")
done
sha1="$(git_tree_sha1 -d '@' "${skiplists[@]}")" || die
echo "::set-output name=${job_id}_skip_cache_key::${job_skip_cache_name}_$sha1"
echo "${job_id}_skip_cache_key=${job_skip_cache_name}_$sha1" >> $GITHUB_OUTPUT
echo '::endgroup::' 1>&2
}
Expand All @@ -275,7 +275,7 @@ analyze_set_job_skip_job()
skip_job='no'
fi
info "Skip $job_name? $skip_job"
echo "::set-output name=${job_id}_skip_job::$skip_job"
echo "${job_id}_skip_job=$skip_job" >> $GITHUB_OUTPUT
}
python='python3'
Expand Down
14 changes: 7 additions & 7 deletions .github/workflows/ci/workflow_context.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
cache_epoch: 0 # <- increase number to clear cache.

action_cache: actions/cache@v2
action_checkout: actions/checkout@v2
action_setup_python: actions/setup-python@v2
action_upload_artifact: actions/upload-artifact@v2
action_download_artifact: actions/download-artifact@v2
action_cache: actions/cache@v3
action_checkout: actions/checkout@v3
action_setup_python: actions/setup-python@v4
action_upload_artifact: actions/upload-artifact@v3
action_download_artifact: actions/download-artifact@v3

skippy_enabled: true

Expand All @@ -19,13 +19,13 @@ vars:
variant: macOS
python: '3.9'
os: macOS
platform: macos-10.15
platform: macos-12

- &dist_win
variant: Windows
python: '3.9'
os: Windows
platform: windows-2019
platform: windows-2022

- &dist_other
os: Linux
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/ci/workflow_template.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ jobs:
<% for j in jobs %>
- name: Check skip cache for <@ j.name @>
uses: actions/cache@v2
uses: actions/cache@v3
with:
path: <@ j.skip_cache_path @>
key: <@ cache_epoch @>_check_${{ steps.set_cache.outputs.<@ j.id @>_skip_cache_key }}_${{ github.run_id }}
Expand All @@ -56,7 +56,7 @@ jobs:
<% if skippy_enabled %>
<@ j.shell_definition @>; analyze_set_job_skip_job
<% else %>
echo "::set-output name=<@ j.id @>_skip_job::no"
echo "<@ j.id @>_skip_job=no" >> $GITHUB_OUTPUT
<% endif %>
<% endfor %>
Expand Down Expand Up @@ -141,7 +141,7 @@ jobs:
run: |
python setup.py patch_version
<% if j.type == 'test_packaging' %>
echo "::set-output name=version::$(python setup.py --version)"
echo "version=$(python setup.py --version)" >> $GITHUB_OUTPUT
<% endif %>
<% endif %>
Expand Down
1 change: 1 addition & 0 deletions news.d/feature/1598.osx.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Update GitHub Actions from macOS 10.15 to 12.
1 change: 1 addition & 0 deletions news.d/feature/1598.windows.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Update GitHub Actions from Windows 2019 to 2022.

0 comments on commit d5386f8

Please sign in to comment.