-
Notifications
You must be signed in to change notification settings - Fork 16
173 lines (169 loc) · 6.38 KB
/
isolated.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
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
# Copyright (c) 2024, Oracle and/or its affiliates.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# This code is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License version 2 only, as
# published by the Free Software Foundation.
#
# This code is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
# version 2 for more details (a copy is included in the LICENSE file that
# accompanied this code).
#
# You should have received a copy of the GNU General Public License version
# 2 along with this work; if not, write to the Free Software Foundation,
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
#
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
# or visit www.oracle.com if you need additional information or have any
# questions.
#
# Continuous Integration Workflow for adaptivemm / adaptived
#
# Note: based on libcgroup's continuous-integration.yml
#
name: Isolate Changes
on: ["push", "pull_request"]
jobs:
files-modified:
name: Get modified files
runs-on: ubuntu-latest
outputs:
amm_modified: ${{ steps.adaptivemm.outputs.amm_modified }}
ad_modified: ${{ steps.adaptived.outputs.ad_modified }}
steps:
- uses: actions/checkout@v4
- name: Fetch
run: git fetch
- name: Set adaptivemm-modified to 1 if files were changed
id: adaptivemm
env:
BRANCH: ${{ github.base_ref }}
run: |
echo "BRANCH = $BRANCH"
if [[ -n "$BRANCH" ]]; then amm_modified=$(./diff.sh -m -s origin/$BRANCH) ; else amm_modified=$(./diff.sh -m) ; fi
echo "amm_modified=$amm_modified"
echo "amm_modified=$amm_modified" >> $GITHUB_OUTPUT
- name: Set adaptived-modified to 1 if files were changed
id: adaptived
env:
BRANCH: ${{ github.base_ref }}
run: |
echo "BRANCH = $BRANCH"
if [[ -n "$BRANCH" ]]; then ad_modified=$(./diff.sh -d -s origin/$BRANCH) ; else ad_modified=$(./diff.sh -d) ; fi
echo "ad_modified=$ad_modified"
echo "ad_modified=$ad_modified" >> $GITHUB_OUTPUT
adaptivemm-modified-check:
name: adaptivemm modification status
needs: [files-modified]
env:
amm_modified: ${{ needs.files-modified.outputs.amm_modified }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Build the current adaptivemm executable
run: |
make
sha256sum -b adaptivemmd > adaptivemmd.SHA256
cat adaptivemmd.SHA256
- name: Checkout the commit prior to this change
env:
BRANCH: ${{ github.base_ref }}
run: |
git fetch
echo "BRANCH = $BRANCH"
if [[ -n "$BRANCH" ]]; then git checkout origin/$BRANCH ; else git checkout origin/master ; fi
- name: Build the previous adaptivemm executable
id: shastep
continue-on-error: true
run: |
make clean
make
sha256sum -b adaptivemmd
sha256sum -c adaptivemmd.SHA256
- name: Print Results
run: |
if [[ $amm_modified == 1 ]]; then
if [[ ${{ steps.shastep.outcome }} == 'failure' ]]; then
echo "adaptivemm source was modified, and the SHA256 changed as expected"
else
echo "WARNING: adaptivemm source was modified, but the SHA256SUM didn't change"
fi
else
if [[ ${{ steps.shastep.outcome }} == 'failure' ]]; then
echo "ERROR: adaptivemm source was not modified, but the SHA256SUM changed"
else
echo "adaptivemm source was not modified, and the SHA256 remained the same"
fi
fi
- name: Verbose
env:
BRANCH: ${{ github.base_ref }}
run: |
echo "BRANCH = $BRANCH"
git checkout ${{ github.sha }}
echo "The following files were changed:"
if [[ -n "$BRANCH" ]]; then ./diff.sh -m -s origin/$BRANCH -v ; else ./diff.sh -m -v ; fi
adaptived-modified-check:
name: adaptived modification status
needs: [files-modified]
env:
ad_modified: ${{ needs.files-modified.outputs.ad_modified }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install libjson-c-dev lcov cmake bison flex autoconf automake libtool libsystemd-dev -y
- name: Build the current adaptived executable
run: |
pushd adaptived
./autogen.sh
./configure
make
sha256sum -b src/adaptived > adaptived.SHA256
cat adaptived.SHA256
popd
- name: Checkout the commit prior to this change
env:
BRANCH: ${{ github.base_ref }}
run: |
git fetch
echo "BRANCH = $BRANCH"
if [[ -n "$BRANCH" ]]; then git checkout origin/$BRANCH ; else git checkout origin/master ; fi
- name: Build the previous adaptived executable
id: shastep
continue-on-error: true
run: |
pushd adaptived
./autogen.sh
./configure
make clean
make
sha256sum -b src/adaptived
sha256sum -c adaptived.SHA256
- name: Print Results
run: |
if [[ $ad_modified == 1 ]]; then
if [[ ${{ steps.shastep.outcome }} == 'failure' ]]; then
echo "adaptived source was modified, and the SHA256 changed as expected"
else
echo "WARNING: adaptived source was modified, but the SHA256SUM didn't change"
fi
else
if [[ ${{ steps.shastep.outcome }} == 'failure' ]]; then
echo "ERROR: adaptived source was not modified, but the SHA256SUM changed"
else
echo "adaptived source was not modified, and the SHA256 remained the same"
fi
fi
- name: Verbose
env:
BRANCH: ${{ github.base_ref }}
run: |
echo "BRANCH = $BRANCH"
git checkout ${{ github.sha }}
echo "The following files were changed:"
if [[ -n "$BRANCH" ]]; then ./diff.sh -d -s origin/$BRANCH -v ; else ./diff.sh -d -v ; fi