-
Notifications
You must be signed in to change notification settings - Fork 21
44 lines (40 loc) · 1.6 KB
/
build-basis.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
name: Builds BASIS UEDGE using Docker
on: [push, pull_request]
jobs:
run-all-tests:
name: Builds BASIS UEDGE using Docker
runs-on: ubuntu-latest
strategy:
fail-fast: false
steps:
- uses: actions/checkout@v4
- name: Set UBUNTU tags env variables.
if: runner.os == 'Linux'
run: |
# Set "checking" variable to false by default.
echo "has_tags=false" >> $GITHUB_ENV
# Get your last commit message, not the merge commit.
text=$(git log -1 --no-merges --pretty=%B)
# Read the commit message into an array split by "#".
readarray -d "#" -t commit_message <<< "$text"
# Sanity check.
echo "the tags are: ${commit_message[1]}"
# Add tags and overwrite "checking" variable to true if there are tags.
if [[ "${commit_message[1]}" == *"@"* ]]; then
echo "spec_tags=${commit_message[1]}" >> $GITHUB_ENV
fi
- name: Build using Docker
if: ${{ ! contains(env.spec_tags, '@nobasis') }}
env:
BRANCH_NAME: ${{ github.head_ref || github.ref_name }}
run: |
echo $BRANCH_NAME
docker run --rm fusionbillm/basisuedge checkout $BRANCH_NAME 2>&1 | tee build.log
if [[ ! $( tail -n 50 build.log ) == *"All level 1 tests passed"* ]]; then
echo "Docker build and/or level 1 tests failed for BASIS build!"
exit 1
fi
if [[ ! $( tail -n 50 build.log ) == *"All level 2 tests passed"* ]]; then
echo "Docker build and/or level 2 tests failed for BASIS build!"
exit 1
fi