diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 0000000..9d3ff1d --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,42 @@ +name: build-and-test + +on: + push: + workflow_dispatch: + +env: + CREDENTIALS_FROM_ENVIRONMENT: 'true' + AWS_REGION: 'us-east-1' + AWS_ROLE_TO_ASSUME: 'arn:aws:iam::922513866616:role/Play-Scraper-AWS-Testing' + +permissions: + id-token: write + contents: read + +jobs: + build-and-test: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - uses: actions/setup-java@v3 + with: + distribution: 'liberica' + java-version: '17.0' + java-package: jdk+fx + + - name: Configure AWS Credentials + id: creds + uses: aws-actions/configure-aws-credentials@v4 + with: + aws-region: ${{ env.AWS_REGION }} + role-to-assume: ${{ env.AWS_ROLE_TO_ASSUME }} + role-session-name: 'GitHub-Actions-Play-Scraper-AWS-Testing' + output-credentials: true + + - name: get caller identity 1 + run: | + aws sts get-caller-identity + +# - run: sbt -v playScrapeServer/publishLocal +# - run: sbt -v playScrape/scripted diff --git a/Jenkinsfile b/Jenkinsfile deleted file mode 100644 index ca522a2..0000000 --- a/Jenkinsfile +++ /dev/null @@ -1,51 +0,0 @@ -#!/usr/bin/env groovy - -pipeline { - - agent any - - environment { - CREDENTIALS_FROM_ENVIRONMENT = 'true' - JAVA_HOME="${tool 'Liberica OpenJDK 17.0.4.1'}" - PATH="${env.JAVA_HOME}/bin:${env.PATH}" - } - - stages { - - stage('Build') { - steps { - sh "sbt -Dsbt.log.noformat=true \"playScrapeServer/publishLocal\"" - } - } - - stage('Test') { - steps { - sh "sbt -Dsbt.log.noformat=true \"playScrape/scripted play-scraper/absolute\" \"playScrape/scripted play-scraper/context\" \"playScrape/scripted play-scraper/delay\" \"playScrape/scripted play-scraper/simple\" \"playScrape/scripted play-scraper/versioned\"" - } - } - - stage('Test Upload') { - steps { - withCredentials([[$class: 'AmazonWebServicesCredentialsBinding', accessKeyVariable: 'AWS_ACCESS_KEY_ID', credentialsId: 'ccl-aws-deploy', secretKeyVariable: 'AWS_SECRET_ACCESS_KEY']]) { - sh "sbt -Dsbt.log.noformat=true \"playScrape/scripted play-scraper/upload\"" - } - } - } - - } - - post { - failure { - library 'netlogo-shared' - sendNotifications('NetLogo/Play-Scraper', 'FAILURE') - } - success { - library 'netlogo-shared' - sendNotifications('NetLogo/Play-Scraper', 'SUCCESS') - } - unstable { - library 'netlogo-shared' - sendNotifications('NetLogo/Play-Scraper', 'UNSTABLE') - } - } -}