Skip to content

Commit c86e128

Browse files
committed
Longsight Github Actions
1 parent c5ba67e commit c86e128

File tree

1 file changed

+28
-30
lines changed

1 file changed

+28
-30
lines changed

.github/workflows/server.yml

Lines changed: 28 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
name: Sakai Server for Cypress
55

66
on:
7-
pull_request:
7+
push:
88

99
jobs:
1010
sakai-deploy:
@@ -14,12 +14,12 @@ jobs:
1414

1515
steps:
1616
- name: Git Checkout
17-
uses: actions/checkout@v2
17+
uses: actions/checkout@v4
1818
- name: JDK 11
19-
uses: actions/setup-java@v1
19+
uses: actions/setup-java@v4
2020
with:
2121
java-version: 11
22-
architecture: x64
22+
distribution: 'temurin'
2323
- name: Cache local Maven repository
2424
uses: actions/cache@v2
2525
with:
@@ -38,7 +38,7 @@ jobs:
3838
export TOMCAT_DIR=$PWD/tomcat
3939
mkdir $TOMCAT_DIR
4040
cd $TOMCAT_DIR
41-
curl -s -o tomcat.tar.gz https://dlcdn.apache.org/tomcat/tomcat-9/v9.0.78/bin/apache-tomcat-9.0.78.tar.gz
41+
curl -s -o tomcat.tar.gz https://dlcdn.apache.org/tomcat/tomcat-9/v9.0.85/bin/apache-tomcat-9.0.85.tar.gz
4242
tar --strip-components=1 -xzf tomcat.tar.gz
4343
git clone https://github.com/sakaiproject/nightly-config.git sakai
4444
cp sakai/master.properties sakai/sakai.properties
@@ -54,37 +54,35 @@ jobs:
5454
echo "log.config=DEBUG.org.mariadb.jdbc" >> sakai/local.properties
5555
cd ..
5656
mvn --batch-mode -DskipTests install sakai:deploy-exploded -Dmaven.tomcat.home=$TOMCAT_DIR
57+
- name: Build skins
58+
env:
59+
MAVEN_OPTS: -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=WARN -Dorg.slf4j.simpleLogger.showDateTime=true -Djava.awt.headless=true -Dmaven.wagon.http.retryHandler.count=2 -Dmaven.wagon.http.pool=true
60+
run: |
61+
cd library
62+
for file in src/skins/default/src/sass/themes/_*.scss; do
63+
theme=${file##*/} # Extract the full filename
64+
theme=${theme#_} # Remove leading underscore
65+
theme=${theme%.scss} # Remove file extension
66+
mvn --batch-mode -o -DskipTests -Dmaven.tomcat.home=$TOMCAT_DIR install sakai:deploy-exploded -Dsakai.skin.target=$theme
67+
- name: Package Deployed Skin
68+
run: |
69+
tar -czvf library-skin.tar.gz -C $TOMCAT_DIR/webapps/library/skin .
70+
working-directory: ${{ github.workspace }}
71+
72+
- name: Upload Artifact
73+
uses: actions/upload-artifact@v2
74+
with:
75+
name: library-skin
76+
path: library-skin.tar.gz
77+
- name: Start Tomcat
78+
run: |
5779
cd $TOMCAT_DIR
5880
bin/catalina.sh start
5981
- name: Start cloudflared
6082
run: |
6183
curl -sL -o cloudflared.deb https://github.com/cloudflare/cloudflared/releases/latest/download/cloudflared-linux-amd64.deb
6284
sudo dpkg -i cloudflared.deb
6385
cloudflared tunnel --url http://localhost:8443 &
64-
- name: Cypress Checkout
65-
uses: actions/checkout@v2
66-
with:
67-
repository: sakaicontrib/cypress-sakai
68-
path: './cypress-sakai'
69-
- name: Cypress run
70-
uses: cypress-io/github-action@v2
71-
with:
72-
config: baseUrl=http://localhost:8080
73-
working-directory: cypress-sakai
74-
wait-on: 'http://localhost:8080/portal/'
75-
wait-on-timeout: 1800
76-
record: true
77-
browser: chrome
78-
headless: true
79-
env:
80-
CYPRESS_RECORD_KEY: f2049235-3f10-4142-a26c-fc017211a776
81-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
82-
COMMIT_INFO_MESSAGE: ${{ github.event.pull_request.title }}
83-
- name: Check number of MySQL statements
84-
if: ${{ always() }}
85-
run: |
86-
export QUERIES=$(grep ProtocolLoggingProxy tomcat/logs/catalina.out|grep -v ROLLBACK|grep -v COMMIT | wc -l)
87-
echo "::notice title={MySQL Queries}::$QUERIES"
8886
# - name: Sleep fifteen minutes to allow testing
8987
# if: ${{ always() }}
90-
# run: sleep 15m
88+
# run: sleep 4h

0 commit comments

Comments
 (0)