99jobs :
1010 build-and-test :
1111 runs-on : ubuntu-latest
12+ timeout-minutes : 30
1213
1314 steps :
1415 - name : Checkout repository
2021 node-version : ' 24'
2122 cache : ' npm'
2223
24+ - name : " Configure AWS Credentials"
25+ uses :
aws-actions/[email protected] 26+ with :
27+ aws-region : us-east-1
28+ aws-access-key-id : ${{ secrets.AWS_ACCESS_KEY_ID }}
29+ aws-secret-access-key : ${{ secrets.AWS_SECRET_ACCESS_KEY }}
30+ if : github.event_name != 'pull_request'
31+
32+ - name : S3 test
33+ run : |
34+ aws s3 ls s3://pyret-horizon/new-horizons
35+ if : github.event_name != 'pull_request'
36+
2337 - name : Install Chrome and ChromeDriver
2438 run : |
2539 # Get latest stable Chrome version
7589 echo "SHARED_FETCH_SERVER=https://code.pyret.org" >> $GITHUB_ENV
7690 echo "URL_FILE_MODE=all-remote" >> $GITHUB_ENV
7791 echo "IMAGE_PROXY_BYPASS=true" >> $GITHUB_ENV
92+ echo "POSTMESSAGE_ORIGIN=*" >> $GITHUB_ENV
7893
7994 - name : Start application server
8095 run : |
@@ -89,18 +104,20 @@ jobs:
89104
90105 - name : Run tests
91106 run : |
92- # Set up virtual display for headless browser testing
93- export DISPLAY=:99
94- Xvfb :99 -screen 0 1024x768x24 > /dev/null 2>&1 &
95-
96107 # Wait a bit more for everything to be ready
97108 sleep 3
98109
99110 # Run tests based on event type
100111 if [ "${{ github.event_name }}" = "pull_request" ]; then
101112 echo "Running PR tests (excluding modules)"
102- npx mocha --grep modules --invert
113+ npm run mocha -- --grep modules --invert
103114 else
104115 echo "Running all tests"
105- npx mocha
116+ npm run mocha
106117 fi
118+
119+ - name : Copy cpo-main and related JS to S3
120+ run : |
121+ aws s3 sync ./build/web/js s3://pyret-horizon/horizon-action-test --acl public-read --exclude "*" --include "cpo-main.jarr.gz.js" --content-encoding gzip
122+ aws s3 sync ./build/web/js s3://pyret-horizon/horizon-action-test --acl public-read --exclude "cpo-main.jarr.js.gz"
123+ if : github.event_name != 'pull_request'
0 commit comments