Skip to content

Commit

Permalink
Added CI/CD file
Browse files Browse the repository at this point in the history
  • Loading branch information
benedikt-schesch committed May 5, 2024
1 parent f180fe2 commit b6762d9
Show file tree
Hide file tree
Showing 2 changed files with 66 additions and 7 deletions.
50 changes: 50 additions & 0 deletions .github/workflows/check-reproducibility.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: Run Small test
on: [push, pull_request]
jobs:
test:
strategy:
matrix:
maven: [ '3.9.2' ]
runs-on: ubuntu-latest
defaults:
run:
shell: bash -l {0}
steps:
- uses: actions/setup-java@v3
with:
distribution: 'zulu'
java-version: 17
- run: echo "JAVA17_HOME=$JAVA_HOME" >> $GITHUB_ENV
- run: java -version
- uses: actions/checkout@v4
with:
submodules: 'true'
- name: Set up Python 3.12
uses: actions/setup-python@v5
with:
python-version: '3.12'
- name: Setup miniconda
uses: conda-incubator/setup-miniconda@v3
with:
python-version: 3.12
auto-update-conda: true
mamba-version: "*"
channels: conda-forge,defaults
activate-environment: AST
environment-file: environment.yml
- name: Install maven
uses: s4u/[email protected]
with:
java-version: 17
maven-version: ${{ matrix.maven }}
- name: Clean caches & workspace
run: make clean
- run: echo "LOGURU_COLORIZE=NO" >> $GITHUB_ENV
- name: Run small test
run: |
git config --global user.email "[email protected]"
git config --global user.name "Example Example"
head -n 101 results/combined/result.csv > results/combined/result_trimmed.csv
make check-merges-reproducibilit
env:
GITHUB_TOKEN: ${{ secrets.TOKEN_GITHUB }}
23 changes: 16 additions & 7 deletions src/python/replay_merge.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"""Replay merges and their test results"""
import argparse
import os
import sys
from pathlib import Path
import shutil
import pandas as pd
Expand Down Expand Up @@ -75,13 +76,21 @@ def merge_replay(
f"workdir {WORKDIR_DIRECTORY/workdir} already exists. Skipping"
)
continue

repo = Repository(
repo_slug,
cache_directory=Path("no_cache/"),
workdir_id=workdir,
delete_workdir=delete_workdir,
)
try:
repo = Repository(
repo_slug,
cache_directory=Path("no_cache/"),
workdir_id=workdir,
delete_workdir=delete_workdir,
lazy_clone=False,
)
except Exception as e:
logger.error(
f"Git clone failed for {repo_slug} {merge_data['left']}"
+ f"{merge_data['right']} {e}"
)
# Exit with 0 for CI/CD to not cause problems in case a repo is no longer available
sys.exit(0)
(
merge_result,
merge_fingerprint,
Expand Down

0 comments on commit b6762d9

Please sign in to comment.