CI #965
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CWS CI LDAP | |
# Triggers the workflow on push | |
on: | |
push: | |
schedule: | |
# trigger a build and test of CWS weekly on Monday at 5 AM PST / 12 PM UTC | |
- cron: '0 12 * * 1' | |
env: | |
TEAM: ("jamesfwood" "voxparcxls" "galenhollins" "galenatjpl" "jeffreypon") | |
jobs: | |
build-and-test-cws: | |
runs-on: ubuntu-latest | |
env: | |
SECURITY: "LDAP" | |
WORKERS: 1 | |
services: | |
mdb106: | |
image: public.ecr.aws/docker/library/mariadb:10.6 | |
ports: | |
- 3306:3306 | |
env: | |
MYSQL_DATABASE: cws_dev | |
MYSQL_ROOT_PASSWORD: adminpw | |
options: >- | |
--name mdb106 --health-cmd="mysqladmin ping --silent" --health-interval=10s --health-timeout=5s --health-retries=3 | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Dependencies | |
run: | | |
sudo apt-get update | |
sudo apt-get install -y curl wget iproute2 unzip maven jq sed mysql-client gnupg | |
curl --version | |
- name: Set up JDK 17 | |
uses: actions/setup-java@v4 | |
with: | |
java-version: '17' | |
distribution: 'temurin' | |
- name: Cache Maven packages | |
uses: actions/cache@v4 | |
with: | |
path: ~/.m2/repository | |
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }} | |
restore-keys: | | |
${{ runner.os }}-m2- | |
- name: Create open-source certs | |
run: | | |
cd cws-certs | |
chmod +x generate-certs.sh | |
./generate-certs.sh | |
- name: Set up Keystore storepass | |
run: | | |
mkdir ~/.cws/ | |
chmod 700 ~/.cws/ | |
echo ${{ secrets.KEYSTORE_PASSWORD }} > ~/.cws/creds | |
chmod 600 ~/.cws/creds | |
- name: Download Logstash | |
run: | | |
curl -o install/logging/logstash-8.12.0.zip https://artifacts.elastic.co/downloads/logstash/logstash-8.12.0-windows-x86_64.zip | |
- name: Check for Logstash | |
run: | | |
cd install/logging/ | |
ls -l | |
- name: Set up Elasticsearch | |
run: | | |
cd install/docker/es-only | |
docker compose up -d | |
- name: Show Docker containers | |
run: | | |
sleep 5s | |
docker ps -a | |
- name: Build CWS | |
id: build | |
run: | | |
cd ci | |
chmod +x run_ci.sh | |
./run_ci.sh $SECURITY $WORKERS | |
shell: bash | |
- name: Show CWS Log | |
run: | | |
cd dist/console-only/cws/server/apache-tomcat-9.0.75/logs | |
ls -al | |
- name: Set up Google Chrome | |
run: | | |
sudo apt update | |
sudo apt install -y google-chrome-stable | |
- name: Display Google Chrome version | |
run: google-chrome --version | |
- name: Run LDAP Integration Tests | |
id: ldap | |
run: mvn -Dmaven.compiler.debug=true -Dmaven.compiler.debuglevel=lines,vars, -Dit.test=LdapTestIT verify -DskipTests | |
shell: bash | |
- name: Send custom JSON data to Slack workflow | |
if: ${{ always() && contains(env.TEAM, github.actor) }} | |
id: slack | |
uses: slackapi/[email protected] | |
with: | |
# This data can be any valid JSON from a previous step in the GitHub Action | |
payload: | | |
{ | |
"status": "CWS CI LDAP build and test result: ${{ job.status }}\n${{ github.event.pull_request.html_url || github.event.head_commit.url }}\nBuild result: ${{ steps.build.outcome }}\nLDAP integration test result: ${{ steps.ldap.outcome }}", | |
"blocks": [ | |
{ | |
"type": "section", | |
"text": { | |
"type": "mrkdwn", | |
"text": "CWS CI LDAP build and test result: ${{ job.status }}\n${{ github.event.pull_request.html_url || github.event.head_commit.url }}\nBuild result: ${{ steps.build.outcome }}\nLDAP integration test result: ${{ steps.ldap.outcome }}" | |
} | |
} | |
] | |
} | |
env: | |
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} |