Skip to content

updated github actions configuration #11

updated github actions configuration

updated github actions configuration #11

Workflow file for this run

on:
push:
branches-ignore:
# dependabot branches will fail on push since they run with fork-level permissions despite being in the main repo.
# said branches are tested anyhow when dependabot makes its PR and the pull_request triggers the run.
- 'dependabot/**'
pull_request:
name: CI
jobs:
prepare:
name: Prepare
runs-on: ubuntu-22.04
outputs:
github_commit_desc: ${{ steps.get_commit_desc.outputs.github_commit_desc }}
steps:
- name: Checkout
uses: actions/checkout@v4.1.2
with:
fetch-depth: 0
- name: Get head branch latest commit
run: echo "GITHUB_PR_HEAD_SHA=$(git log --pretty=format:'%h' $GITHUB_SHA^2 -1)" >> $GITHUB_ENV
- name: Get base branch latest commit
run: echo "GITHUB_PR_BASE_SHA=$(git log --pretty=format:'%h' $GITHUB_SHA^1 -1)" >> $GITHUB_ENV
- name: Get latest commit
run: echo "GITHUB_HEAD_SHA=$(git log --pretty=format:'%h' -1)" >> $GITHUB_ENV
- name: install packages
run: |
sudo dpkg --add-architecture i386
sudo apt-get update
sudo apt-get install wine32
sudo apt-get install -y wine winetricks wget xvfb
- name: start xvfb
run: Xvfb :0 -screen 0 1024x768x16 &
- name: configure wine
run: winetricks -q win10
- name: Download Python
run: wget https://www.python.org/ftp/python/3.12.3/python-3.12.3-amd64.exe
- name: installing Python on wine
run: wine python-3.12.3-amd64.exe /quiet /log log.txt
# on a pull_request event in github actions, the tests are not run on the head branch of the PR, rather they are run on the merge commit of head merged into the base branch
# this means the latest commit in github actions, which is used for build artifact names is a commit that does not exist in the repository
# so on pull requests we create a user-friendly string to use in place of the merge commit sha, otherwise we just use the normal git HEAD sha.
- id: get_commit_desc
run: |
if [[ ${{ github.event_name }} == 'pull_request' ]]; then
echo "github_commit_desc=merge-${{ env.GITHUB_PR_HEAD_SHA }}-into-${{ env.GITHUB_PR_BASE_SHA }}" >> $GITHUB_OUTPUT
else
echo "github_commit_desc=${{ env.GITHUB_HEAD_SHA }}" >> $GITHUB_OUTPUT
fi