Skip to content

Version Testing

Version Testing #1069

name: Version Testing
on:
push:
schedule:
- cron: "0 7 * * *"
jobs:
test-untested-versions:
runs-on: ubuntu-20.04
strategy:
matrix:
# NOTE: if these are updated, don't forget to
# update the download-artifacts versions as well
node_cimg_tag: [ 14, 16, 18, 20 ]
name: test-untested-versions
steps:
- uses: actions/checkout@v4
- name: Set up Node
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node_cimg_tag }}
- run: |
sudo apt-get update
sudo apt-get install \
build-essential \
libcairo2-dev \
libjpeg-dev \
libgif-dev \
librsvg2-dev
sudo apt-get install \
libpango1.0-dev \
libsdl-pango-dev || true # Node.js 18 does not carry pango
- run: npm ci
- run: npm run build
- run: mkdir versions_artifact
- run: npm run test:untested-instrumentations
- 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.node_cimg_tag }}
path: versions_artifact
create-pr-for-new-versions:
runs-on: ubuntu-latest
name: create-pr-for-new-versions
needs: test-untested-versions
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
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: 14
path: versions_artifacts/14
- uses: actions/download-artifact@v4
continue-on-error: true
with:
name: 16
path: versions_artifacts/16
- uses: actions/download-artifact@v4
continue-on-error: true
with:
name: 18
path: versions_artifacts/18
- uses: actions/download-artifact@v4
continue-on-error: true
with:
name: 20
path: versions_artifacts/20
- run: python3 -m pip install -r ./requirements-ci.txt
# TODO replace this with a node.js script
- run: PYTHONPATH=${PYTHONPATH}:$(pwd)/scripts python3 -m gather_version_artifacts
- run: git --no-pager diff
- run: rm -rf versions_artifacts # the artifacts shouldn't be committed
- run: echo "::set-output name=branch_name::$(date +version-testing-%Y%m%d)"
id: branch_name
- run: | # update 'Supported packages' section in README.md
PYTHONPATH=${PYTHONPATH}:$(pwd)/scripts 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="$(./scripts/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@v5
with:
token: "${{ secrets.GITHUB_TOKEN }}"
title: "chore: ${{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,shanishiri
delete-old-version-testing-branches:
runs-on: ubuntu-latest
name: delete-old-version-testing-branches
needs: create-pr-for-new-versions
steps:
- uses: actions/checkout@v4
- run: | # remove all the version testing branches that aren't from today
./scripts/delete_old_version_testing_branches.sh