-
Notifications
You must be signed in to change notification settings - Fork 2
141 lines (106 loc) · 3.4 KB
/
run_tests.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
---
name: Run test using container
on:
push:
branches:
- test/maccGradedCase
pull_request:
types:
- opened
- synchronize
- reopened
- closed
jobs:
run-tests:
name: Run AutoIG Tests
runs-on: ubuntu-latest
defaults:
run:
shell: bash
container:
#previous version
#ghcr.io/conjure-cp/conjure@sha256:e959c664d83a08b68a5b31409d56ce82eadf0f0b74f8af1809642b73f652c940
# Current version of conjure
# image: ghcr.io/conjure-cp/conjure@sha256:ebff76918718631f099544eed3a808cd16ce8f2c863c8229c7d2e417ba745c56
image: ghcr.io/conjure-cp/conjure:main
steps:
- name: Checkout code
# Checkout repo: checks out current repo (so AutoIG current branch)
uses: actions/checkout@v4
# Clones the current branch being pushed from
# Run same commands as in Docker file, this needs to be updated if there are major updates to Docker later on
# The two should be consistent
- name: Run container and execute script
run: >
apt-get update
DEBIAN_FRONTEND=noninteractive apt-get install -y \
bash \
sudo \
wget \
curl \
gnupg \
software-properties-common \
unzip
# Installing Python Dependencies
sudo apt-get install -y python3-pip
apt install python3-pandas -y
apt install python3-numpy -y
sudo apt install python-is-python3
sudo apt-get install r-base -y
sudo apt-get install git-all -y
# Getting current branch
CURRENT_BRANCH="${{ github.ref_name }}"
git clone -b "$CURRENT_BRANCH" https://github.com/vincepick/AutoIG.git
bash bin/install-savilerow.sh
bash bin/install-mininzinc.sh
bash bin/install-runsolver.sh
bash bin/install-irace.sh
bash bin/install-ortools.sh
bash bin/install-yuck.sh
bash bin/install-picat.sh
ls
echo "Environment made :D, path:"
echo $PATH
# Run script for Push Events
- name: Run Push Tests
if: ${{ github.event_name == 'push' }}
run: |
cd AutoIG
. bin/set-path.sh
AUTOIG=$(pwd)
cd $AUTOIG/scripts/testScripts
echo "Running basic tests for Push"
bash check_push.sh
# Run script for Conjure tsts
- name: Run Conjure Tests
if: ${{ github.event_name == 'push' }}
run: |
cd AutoIG
. bin/set-path.sh
AUTOIG=$(pwd)
cd $AUTOIG/scripts/testScripts
echo "Running basic tests for Conjure Usage"
bash check_conjure.sh
# Run script for pull request Events
- name: Run Pull Request Tests
if: ${{ github.event_name == 'pull_request' }}
run: |
cd AutoIG
. bin/set-path.sh
AUTOIG=$(pwd)
cd $AUTOIG/scripts/testScripts
echo "Running more thorough tests for Pull Request"
bash check_push.sh
bash check_pr.sh
# If fail, reject
- name: Fail
if: ${{ failure() }}
run: |
echo "These tests failed, rejecting PR."
exit 1
# If pass approve
- name: Pass
if: ${{ success() }}
run: |
echo "These tests passed! allowing PR."
exit 0