<commit_before>#!/bin/bash

set -ex

# Build an image
sudo add-apt-repository --yes ppa:jonathonf/python-3.6
sudo apt --yes update
sudo apt --yes install python3.6 python3-pip debootstrap systemd-container squashfs-tools

testimg()
{
	img="$1"
	sudo python3.6 ./mkosi --default ./mkosi.files/mkosi."$img"
	test -f mkosi.output/"$img".raw
	rm mkosi.output/"$img".raw
}

# Only test ubuntu images for now, as semaphore is based on Ubuntu
for i in ./mkosi.files/mkosi.ubuntu*
do
	imgname="$(basename "$i" | cut -d. -f 2-)"
	testimg "$imgname"
done

# Run unit tests
sudo python3.6 -m pip install pytest
sudo python3.6 -m pytest<commit_msg>ci: use different ppa for python 3.6<commit_after>#!/bin/bash

set -ex

# Build an image
sudo add-apt-repository --yes ppa:deadsnakes/ppa
sudo apt --yes update
sudo apt --yes install python3.6 python3-pip debootstrap systemd-container squashfs-tools

testimg()
{
	img="$1"
	sudo python3.6 ./mkosi --default ./mkosi.files/mkosi."$img"
	test -f mkosi.output/"$img".raw
	rm mkosi.output/"$img".raw
}

# Only test ubuntu images for now, as semaphore is based on Ubuntu
for i in ./mkosi.files/mkosi.ubuntu*
do
	imgname="$(basename "$i" | cut -d. -f 2-)"
	testimg "$imgname"
done

# Run unit tests
sudo python3.6 -m pip install pytest
sudo python3.6 -m pytest
{'fraction_non_alphanumeric': 0.13809154383242825, 'fraction_numerical': 0.02017067494181536, 'mean_word_length': 3.574468085106383, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3897406', 'n_tokens_mistral': 515, 'n_tokens_neox': 479, 'n_words': 153}