Version Testing #954
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Version Testing | |
on: | |
push: | |
paths-ignore: | |
- '.github/**' | |
- '**.md' | |
schedule: | |
- cron: '0 7 * * *' | |
jobs: | |
check-new-versions-of-instrumented-packages: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
# NOTE: if these are updated, don't forget to | |
# update the download-artifacts versions as well | |
jdk_version: [ 11, 17, 21] | |
name: check-new-versions-of-instrumented-packages | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up JDK ${{ matrix.jdk_version }} | |
uses: actions/setup-java@v4 | |
with: | |
distribution: temurin | |
java-version: ${{ matrix.jdk_version }} | |
- name: Configure aws credentials | |
uses: aws-actions/configure-aws-credentials@v4 | |
with: | |
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY }} | |
aws-secret-access-key: ${{ secrets.AWS_SECRET_KEY }} | |
aws-region: 'us-west-2' | |
- run: ./gradlew clean | |
- run: ./gradlew build -x test | |
- run: mkdir versions_artifact | |
- run: .github/retrieveDependencyVersions.sh | |
- run: git --no-pager diff | |
- run: | | |
for path in `git diff --name-only`; do | |
if [[ $path == *"tested_versions"* ]]; then | |
cp "$path" versions_artifact; | |
fi | |
done | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: ${{ matrix.jdk_version }} | |
path: versions_artifact | |
push-branch: | |
runs-on: ubuntu-latest | |
name: push-branch | |
if: github.ref == 'refs/heads/main' | |
needs: check-new-versions-of-instrumented-packages | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: 3.7 | |
- run: mkdir versions_artifacts | |
- uses: actions/download-artifact@v4 | |
continue-on-error: true # when there aren't changes the artifact won't be uploaded and this step will fail | |
with: | |
name: 11 | |
path: versions_artifacts/11 | |
- uses: actions/download-artifact@v4 | |
continue-on-error: true | |
with: | |
name: 17 | |
path: versions_artifacts/17 | |
- uses: actions/download-artifact@v4 | |
continue-on-error: true | |
with: | |
name: 21 | |
path: versions_artifacts/21 | |
- run: python3 -m pip install -r .github/requirements-ci.txt | |
- run: PYTHONPATH=${PYTHONPATH}:$(pwd)/.github python3 -m gather_version_artifacts | |
- run: git --no-pager diff | |
- run: rm -rf versions_artifacts # the artifacts shouldn't be committed | |
- run: echo "branch_name=$(date +version-testing-%Y%m%d)" >>$GITHUB_OUTPUT | |
id: branch_name | |
- run: | # update 'Supported packages' section in README.md | |
PYTHONPATH=${PYTHONPATH}:$(pwd)/.github python3 -m update_supported_packages_documentation | |
- run: | # need to set an env var in order to support multi-lines output https://trstringer.com/github-actions-multiline-strings/ | |
new_versions="$(.github/describe_supported_versions_diff.sh)" | |
echo "new_versions<<EOF" >> $GITHUB_ENV | |
echo "$new_versions" >> $GITHUB_ENV | |
echo "EOF" >> $GITHUB_ENV | |
- name: Create Pull Request | |
uses: peter-evans/create-pull-request@v6 | |
with: | |
token: "${{ secrets.GITHUB_TOKEN }}" | |
title: "ci: ${{steps.branch_name.outputs.branch_name}}" | |
branch: ${{steps.branch_name.outputs.branch_name}} | |
commit-message: ${{ env.new_versions }} | |
body: ${{ env.new_versions }} | |
base: main | |
labels: version-testing, automerge | |
reviewers: GuyMoses,nadav3396 |