Skip to content

Commit ec5886e

Browse files
author
Ivan Cao-Berg
committed
Added GitHub Actions
1 parent f7da13c commit ec5886e

File tree

2 files changed

+147
-0
lines changed

2 files changed

+147
-0
lines changed

.github/workflows/main.yml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: Container build
2+
on: [push, pull_request]
3+
jobs:
4+
build:
5+
name: Build
6+
runs-on: ubuntu-latest
7+
strategy:
8+
matrix:
9+
singularity_version:
10+
- '3.7.3'
11+
container:
12+
image: quay.io/singularity/singularity:v${{ matrix.singularity_version }}
13+
options: --privileged
14+
steps:
15+
- name: Check out code for the container build
16+
uses: actions/checkout@v1
17+
18+
- name: Build and test container
19+
run: |
20+
for DIRECTORY in *
21+
do
22+
if [ -d $DIRECTORY ]; then
23+
if [ $DIRECTORY != 'images' ]; then
24+
cd $DIRECTORY
25+
26+
echo "Building container"
27+
bash ./build.sh
28+
29+
if [ -f ./test.sh ]; then
30+
echo "Running tests"
31+
bash ./test.sh
32+
else
33+
echo "Test file not found. Skipping tests."
34+
fi
35+
cd ..
36+
fi
37+
fi
38+
done

.github/workflows/pretty.yml

Lines changed: 109 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,109 @@
1+
name: Publishing ready
2+
on: [push, pull_request]
3+
jobs:
4+
build:
5+
name: Build
6+
runs-on: ubuntu-latest
7+
steps:
8+
- name: Check out code
9+
uses: actions/checkout@v2
10+
11+
- name: Install useful utilities
12+
run: sudo apt-get install -y tree
13+
14+
- name: Checking if LICENSE exists
15+
run: |
16+
FILE=LICENSE
17+
if [ -f "$FILE" ]; then
18+
echo "File "$FILE" exists."
19+
exit 0
20+
else
21+
echo "File $FILE does not exist."
22+
exit 1
23+
fi
24+
25+
- name: Checking if Apache License Version 2.0, January 2004 is being used
26+
run: |
27+
if grep --quiet "Apache License" LICENSE && grep --quiet "Version 2.0, January 2004" LICENSE; then
28+
echo "Using Apache License Version 2.0, January 2004"
29+
exit 0
30+
else
31+
echo "Not using Apache License Version 2.0, January 2004"
32+
exit 1
33+
fi
34+
35+
- name: Checking if CONTRIBUTING guide exists
36+
run: |
37+
FILE=CONTRIBUTING.md
38+
if [ -f "$FILE" ]; then
39+
echo "File "$FILE" exists."
40+
exit 0
41+
else
42+
echo "File $FILE does not exist."
43+
exit 1
44+
fi
45+
46+
- name: Checking if README file exists
47+
run: |
48+
FILE=README.md
49+
if [ -f "$FILE" ]; then
50+
echo "File "$FILE" exists."
51+
exit 0
52+
else
53+
echo "File $FILE does not exist."
54+
exit 1
55+
fi
56+
57+
- name: Checking if copyrighted to Pittsburgh Supercomputing Center
58+
run: |
59+
if grep --quiet "Pittsburgh Supercomputing Center. All Rights Reserved." README.md; then
60+
echo "Copyright (c) Pittsburgh Supercomputing Center"
61+
exit 0
62+
else
63+
echo "No reference to Pittsburgh Supercomputing Center"
64+
exit 1
65+
fi
66+
67+
- name: Checking if there exists at least one Singularity definition file
68+
run: |
69+
FILE=Singularity
70+
if [ $(find . -name "$FILE" -mmin -5 | wc -l) -gt 0 ]; then
71+
echo "File "$FILE" was found.";
72+
exit 0
73+
else
74+
echo "File "$FILE" was not found.";
75+
exit 1
76+
fi
77+
78+
- name: Checking if there exists at least one build script
79+
run: |
80+
FILE=build.sh
81+
if [ $(find . -name "$FILE" -mmin -5 | wc -l) -gt 0 ]; then
82+
echo "File "$FILE" was found.";
83+
exit 0
84+
else
85+
echo "File "$FILE" was not found.";
86+
exit 1
87+
fi
88+
89+
- name: Checking if there exists at least one remote build script
90+
run: |
91+
FILE=rbuild.sh
92+
if [ $(find . -name "$FILE" -mmin -5 | wc -l) -gt 0 ]; then
93+
echo "File "$FILE" was found.";
94+
exit 0
95+
else
96+
echo "File "$FILE" was not found.";
97+
exit 1
98+
fi
99+
100+
- name: Checking if there exists at least one test script
101+
run: |
102+
FILE=test.sh
103+
if [ $(find . -name "$FILE" -mmin -5 | wc -l) -gt 0 ]; then
104+
echo "File "$FILE" was found.";
105+
exit 0
106+
else
107+
echo "File "$FILE" was not found.";
108+
exit 1
109+
fi

0 commit comments

Comments
 (0)