Merge pull request #105 from jluhrs/sc-7010-manual-control-of-m2-baffles #419
This file contains hidden or 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
# This file was automatically generated by sbt-github-actions using the | |
# githubWorkflowGenerate task. You should add and commit this file to | |
# your git repository. It goes without saying that you shouldn't edit | |
# this file by hand! Instead, if you wish to make changes, you should | |
# change your sbt build configuration to revise the workflow description | |
# to meet your needs, then regenerate this file. | |
name: Continuous Integration | |
on: | |
pull_request: | |
branches: ['**', '!update/**', '!pr/**'] | |
push: | |
branches: ['**', '!update/**', '!pr/**'] | |
permissions: | |
actions: write | |
checks: write | |
contents: read | |
deployments: write | |
id-token: write | |
issues: write | |
packages: write | |
pages: write | |
pull-requests: write | |
repository-projects: write | |
security-events: write | |
statuses: write | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
FONTAWESOME_NPM_AUTH_TOKEN: ${{ secrets.FONTAWESOME_NPM_AUTH_TOKEN }} | |
HEROKU_API_KEY: ${{ secrets.HEROKU_API_KEY }} | |
concurrency: | |
group: ${{ github.workflow }} @ ${{ github.ref }} | |
cancel-in-progress: true | |
jobs: | |
build: | |
name: Test | |
strategy: | |
matrix: | |
os: [ubuntu-22.04] | |
scala: [3] | |
java: [temurin@17] | |
project: [rootJS, rootJVM] | |
runs-on: ${{ matrix.os }} | |
timeout-minutes: 60 | |
steps: | |
- name: Checkout current branch (full) | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Setup sbt | |
uses: sbt/setup-sbt@v1 | |
- name: Setup Java (temurin@17) | |
id: setup-java-temurin-17 | |
if: matrix.java == 'temurin@17' | |
uses: actions/setup-java@v4 | |
with: | |
distribution: temurin | |
java-version: 17 | |
cache: sbt | |
- name: sbt update | |
if: matrix.java == 'temurin@17' && steps.setup-java-temurin-17.outputs.cache-hit == 'false' | |
run: sbt -v -J-Xmx6g +update | |
- name: Explore Setup Node.js | |
uses: actions/setup-node@v6 | |
with: | |
node-version: 24 | |
cache: npm | |
- name: Cache Explore node_modules | |
id: explore-cache-node_modules | |
uses: actions/cache@v4 | |
with: | |
path: node_modules | |
key: explore-node_modules-${{ hashFiles('package-lock.json') }} | |
restore-keys: explore-node_modules | |
- name: npm clean-install | |
if: steps.explore-cache-node_modules.outputs.cache-hit != 'true' | |
run: | | |
cd explore | |
npm clean-install | |
- name: Check that workflows are up to date | |
run: sbt -v -J-Xmx6g githubWorkflowCheck | |
- name: Check headers | |
if: matrix.java == 'temurin@17' && matrix.os == 'ubuntu-22.04' | |
run: sbt -v -J-Xmx6g 'project ${{ matrix.project }}' '++ ${{ matrix.scala }}' headerCheckAll | |
- name: scalaJSLink | |
if: matrix.project == 'rootJS' | |
run: sbt -v -J-Xmx6g 'project ${{ matrix.project }}' '++ ${{ matrix.scala }}' Test/scalaJSLinkerResult | |
- name: Test | |
run: sbt -v -J-Xmx6g 'project ${{ matrix.project }}' '++ ${{ matrix.scala }}' test | |
publish: | |
name: Publish Artifacts | |
needs: [build] | |
if: github.event_name != 'pull_request' && (startsWith(github.ref, 'refs/tags/v') || github.ref == 'refs/heads/main') | |
strategy: | |
matrix: | |
os: [ubuntu-22.04] | |
java: [temurin@17] | |
runs-on: ${{ matrix.os }} | |
steps: | |
- name: Checkout current branch (full) | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Setup sbt | |
uses: sbt/setup-sbt@v1 | |
- name: Setup Java (temurin@17) | |
id: setup-java-temurin-17 | |
if: matrix.java == 'temurin@17' | |
uses: actions/setup-java@v4 | |
with: | |
distribution: temurin | |
java-version: 17 | |
cache: sbt | |
- name: sbt update | |
if: matrix.java == 'temurin@17' && steps.setup-java-temurin-17.outputs.cache-hit == 'false' | |
run: sbt -v -J-Xmx6g +update | |
- uses: actions/setup-node@v6 | |
with: | |
node-version: 24 | |
registry-url: 'https://registry.npmjs.org' | |
cache: npm | |
- name: NPM Publish | |
if: startsWith(github.ref, 'refs/tags/v') | |
run: sbt -v -J-Xmx6g ui_css/npmPublish | |
validate-steward: | |
name: Validate Steward Config | |
strategy: | |
matrix: | |
os: [ubuntu-22.04] | |
java: [temurin@11] | |
runs-on: ${{ matrix.os }} | |
steps: | |
- name: Checkout current branch (fast) | |
uses: actions/checkout@v4 | |
- name: Setup Java (temurin@11) | |
id: setup-java-temurin-11 | |
if: matrix.java == 'temurin@11' | |
uses: actions/setup-java@v4 | |
with: | |
distribution: temurin | |
java-version: 11 | |
- uses: coursier/setup-action@v1 | |
with: | |
apps: scala-steward | |
- run: scala-steward validate-repo-config .scala-steward.conf | |
explore-deploy: | |
name: Build and deploy Explore | |
if: ((github.ref == 'refs/heads/main' || github.event_name == 'pull_request') && startsWith(github.repository, 'gemini')) | |
strategy: | |
matrix: | |
os: [ubuntu-22.04] | |
java: [temurin@17] | |
runs-on: ${{ matrix.os }} | |
steps: | |
- name: Checkout current branch (full) | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Setup sbt | |
uses: sbt/setup-sbt@v1 | |
- name: Setup Java (temurin@17) | |
id: setup-java-temurin-17 | |
if: matrix.java == 'temurin@17' | |
uses: actions/setup-java@v4 | |
with: | |
distribution: temurin | |
java-version: 17 | |
cache: sbt | |
- name: sbt update | |
if: matrix.java == 'temurin@17' && steps.setup-java-temurin-17.outputs.cache-hit == 'false' | |
run: sbt -v -J-Xmx6g +update | |
- name: Explore Setup Node.js | |
uses: actions/setup-node@v6 | |
with: | |
node-version: 24 | |
cache: npm | |
- name: Cache Explore node_modules | |
id: explore-cache-node_modules | |
uses: actions/cache@v4 | |
with: | |
path: node_modules | |
key: explore-node_modules-${{ hashFiles('package-lock.json') }} | |
restore-keys: explore-node_modules | |
- name: npm clean-install | |
if: steps.explore-cache-node_modules.outputs.cache-hit != 'true' | |
run: | | |
cd explore | |
npm clean-install | |
- name: Link Explore | |
run: sbt -v -J-Xmx6g explore_app/buildJsModule | |
- name: Build Explore | |
env: | |
NODE_OPTIONS: '--max-old-space-size=8192' | |
run: | | |
cd explore | |
npm run build | |
- name: override CI_COMMIT_SHA | |
if: github.event_name == 'pull_request' | |
run: echo "CI_COMMIT_SHA=${{ github.event.pull_request.head.sha}}" >> $GITHUB_ENV | |
- name: Run BundleMon | |
uses: lironer/bundlemon-action@v1 | |
with: | |
bundlemon-args: '--config explore/.bundlemonrc.json --subProject "Explore"' | |
- name: Deploy staging app to Firebase | |
if: github.ref == 'refs/heads/main' | |
uses: FirebaseExtended/action-hosting-deploy@v0 | |
with: | |
firebaseServiceAccount: ${{ secrets.FIREBASE_SERVICE_ACCOUNT_EXPLORE_GEMINI }} | |
entryPoint: ./explore | |
projectId: explore-gemini | |
repoToken: ${{ secrets.GITHUB_TOKEN }} | |
target: dev | |
channelId: live | |
- name: Record deployment SHA | |
if: github.ref == 'refs/heads/main' | |
run: | | |
# Create a deployment record with commit SHA for tracking | |
echo "Recording deployment: ${{ github.sha }} to explore-gemini-dev" | |
curl -X POST https://api.github.com/repos/${{ github.repository }}/deployments -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" -H "Accept: application/vnd.github+json" -d '{ "ref": "${{ github.sha }}", "environment": "development", "description": "Explore deployment to dev", "auto_merge": false, "required_contexts": [], "task": "deploy:Explore" }' | |
observe-deploy: | |
name: Build and publish Observe Docker image / Deploy to Heroku | |
if: (github.ref == 'refs/heads/main' && startsWith(github.repository, 'gemini')) | |
strategy: | |
matrix: | |
os: [ubuntu-22.04] | |
scala: [3.7.3] | |
java: [temurin@17] | |
runs-on: ${{ matrix.os }} | |
steps: | |
- name: Checkout current branch (full) | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Setup sbt | |
uses: sbt/setup-sbt@v1 | |
- name: Setup Java (temurin@17) | |
id: setup-java-temurin-17 | |
if: matrix.java == 'temurin@17' | |
uses: actions/setup-java@v4 | |
with: | |
distribution: temurin | |
java-version: 17 | |
cache: sbt | |
- name: sbt update | |
if: matrix.java == 'temurin@17' && steps.setup-java-temurin-17.outputs.cache-hit == 'false' | |
run: sbt -v -J-Xmx6g +update | |
- name: Setup Node.js | |
uses: actions/setup-node@v6 | |
with: | |
node-version: 24 | |
cache: npm | |
- name: Cache Observe node_modules | |
id: observe-cache-node_modules | |
uses: actions/cache@v4 | |
with: | |
path: node_modules | |
key: observe-node_modules-${{ hashFiles('package-lock.json') }} | |
restore-keys: observe-node_modules | |
- name: npm clean-install | |
if: steps.observe-cache-node_modules.outputs.cache-hit != 'true' | |
run: | | |
cd observe/web/client | |
npm clean-install | |
- name: Login to Docker Hub | |
run: echo ${{ secrets.DOCKER_HUB_TOKEN }} | docker login --username nlsoftware --password-stdin | |
- name: Build and Publish Observe Docker image | |
run: 'sbt -v -J-Xmx6g ''++ ${{ matrix.scala }}'' clean observe_deploy/docker:publish' | |
- name: Deploy and release app in Heroku | |
run: | | |
npm install -g heroku | |
heroku container:login | |
docker tag noirlab/gpp-obs registry.heroku.com/${{ vars.HEROKU_APP_NAME_GN || 'observe-dev-gn' }}/web | |
docker push registry.heroku.com/${{ vars.HEROKU_APP_NAME_GN || 'observe-dev-gn' }}/web | |
heroku container:release web -a ${{ vars.HEROKU_APP_NAME_GN || 'observe-dev-gn' }} -v | |
docker tag noirlab/gpp-obs registry.heroku.com/${{ vars.HEROKU_APP_NAME_GS || 'observe-dev-gs' }}/web | |
docker push registry.heroku.com/${{ vars.HEROKU_APP_NAME_GS || 'observe-dev-gs' }}/web | |
heroku container:release web -a ${{ vars.HEROKU_APP_NAME_GS || 'observe-dev-gs' }} -v | |
navigate-deploy: | |
name: Build and publish Navigate Docker image | |
if: (github.ref == 'refs/heads/main' && startsWith(github.repository, 'gemini')) | |
strategy: | |
matrix: | |
os: [ubuntu-22.04] | |
scala: [3.7.3] | |
java: [temurin@17] | |
runs-on: ${{ matrix.os }} | |
steps: | |
- name: Checkout current branch (full) | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Setup sbt | |
uses: sbt/setup-sbt@v1 | |
- name: Setup Java (temurin@17) | |
id: setup-java-temurin-17 | |
if: matrix.java == 'temurin@17' | |
uses: actions/setup-java@v4 | |
with: | |
distribution: temurin | |
java-version: 17 | |
cache: sbt | |
- name: sbt update | |
if: matrix.java == 'temurin@17' && steps.setup-java-temurin-17.outputs.cache-hit == 'false' | |
run: sbt -v -J-Xmx6g +update | |
- name: Login to Docker Hub | |
run: echo ${{ secrets.DOCKER_HUB_TOKEN }} | docker login --username nlsoftware --password-stdin | |
- name: Build and Publish Navigate Docker image | |
run: 'sbt -v -J-Xmx6g ''++ ${{ matrix.scala }}'' clean navigate_deploy/docker:publish' | |
lint: | |
name: Run linters | |
if: ((github.ref == 'refs/heads/main' || github.event_name == 'pull_request') && startsWith(github.repository, 'gemini')) | |
strategy: | |
matrix: | |
os: [ubuntu-22.04] | |
scala: [3.7.3] | |
java: [temurin@17] | |
runs-on: ${{ matrix.os }} | |
steps: | |
- name: Checkout current branch (full) | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Setup sbt | |
uses: sbt/setup-sbt@v1 | |
- name: Setup Java (temurin@17) | |
id: setup-java-temurin-17 | |
if: matrix.java == 'temurin@17' | |
uses: actions/setup-java@v4 | |
with: | |
distribution: temurin | |
java-version: 17 | |
cache: sbt | |
- name: sbt update | |
if: matrix.java == 'temurin@17' && steps.setup-java-temurin-17.outputs.cache-hit == 'false' | |
run: sbt -v -J-Xmx6g +update | |
- name: Explore Setup Node.js | |
uses: actions/setup-node@v6 | |
with: | |
node-version: 24 | |
cache: npm | |
- name: Cache root node_modules | |
id: root-cache-node_modules | |
uses: actions/cache@v4 | |
with: | |
path: node_modules | |
key: root-node_modules-${{ hashFiles('package-lock.json') }} | |
restore-keys: root-node_modules | |
- name: npm clean-install | |
if: steps.root-cache-node_modules.outputs.cache-hit != 'true' | |
run: npm clean-install | |
- name: Import CSS files | |
run: sbt -v -J-Xmx6g '++ ${{ matrix.scala }}' ui_css/lucumaCss | |
- name: Run linters | |
run: | | |
find ui/lib/src/main/resources/lucuma-css -maxdepth 1 -type f -exec sed -n -e '/^[[:space:]]*--.*;[[:space:]]*$/p' -e '/^[[:space:]]*--[^;]*$/,/;$/p' {} + >vars.css | |
npx stylelint explore/common/src/main/webapp/sass | |
npx stylelint observe/web/client/src/main/webapp/styles | |
npx stylelint ui/lib/src/main/resources/lucuma-css | |
rm vars.css | |
find ui/lib/src/main/resources/lucuma-css -maxdepth 1 -type f -exec sed -n -e '/^[[:space:]]*--.*;[[:space:]]*$/p' -e '/^[[:space:]]*--[^;]*$/,/;$/p' {} + >vars.css | |
npx stylelint explore/common/src/main/webapp/sass | |
npx stylelint observe/web/client/src/main/webapp/styles | |
npx stylelint ui/lib/src/main/resources/lucuma-css | |
rm vars.css | |
npx prettier --check . |