Skip to content

Bump cypress-io/github-action from 6.6.1 to 6.7.0 #472

Bump cypress-io/github-action from 6.6.1 to 6.7.0

Bump cypress-io/github-action from 6.6.1 to 6.7.0 #472

Workflow file for this run

name: Test
on:
push:
branches: ["main"]
tags: [ v* ]
pull_request:
types: [ opened, synchronize ]
workflow_dispatch:
# automatically cancel previous runs on the same PR
# https://stackoverflow.com/questions/66335225/how-to-cancel-previous-runs-in-the-pr-when-you-push-new-commitsupdate-the-curre/67939898#67939898
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }}
cancel-in-progress: true
jobs:
build:
strategy:
matrix:
scalaVersion: ["2.13.12", "3.3.1"]
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- uses: coursier/cache-action@v6
- uses: coursier/setup-action@v1
with:
jvm: adoptium:1.17
apps: sbt metals
- uses: actions/setup-node@v4
with:
node-version: "18"
cache: "yarn"
cache-dependency-path: formidable/package.json
- name: Compile
run: |
# Runner has 7G of RAM.
# https://docs.github.com/en/actions/using-github-hosted-runners/about-github-hosted-runners#supported-runners-and-hardware-resources
ENABLE_FATAL_WARNINGS=true SBT_OPTS="-XX:MaxHeapSize=6G" sbt ++${{matrix.scalaVersion}} compile demo/fastOptJS/webpack scalafmtCheck scalafmtSbtCheck
- name: Prepare devserver to run End-to-End UI Tests (Scala 3)
if: startsWith(matrix.scalaVersion, '3.')
run: |
# Start frontend dev-webserver
(
cd demo/target/scala-${{matrix.scalaVersion}}/scalajs-bundler/main || kill 0
node node_modules/webpack-dev-server/bin/webpack-dev-server.js --config webpack.config.dev.js --port 12345 || kill 0
) &
- name: Prepare devserver to run End-to-End UI Tests (Scala 2)
if: startsWith(matrix.scalaVersion, '2.13.')
run: |
# Start frontend dev-webserver
(
cd demo/target/scala-2.13/scalajs-bundler/main || kill 0
node node_modules/webpack-dev-server/bin/webpack-dev-server.js --config webpack.config.dev.js --port 12345 || kill 0
) &
- name: Cypress run
uses: cypress-io/github-action@v6.7.0
- name: Build production assets
if: github.ref == 'refs/heads/main' && startsWith(matrix.scalaVersion, '2.13')
run: |
sbt prod
- name: Check if working directory is clean
run: git diff --quiet --exit-code || (git status && false)
- name: Check if scala version is compatible with latest metals
run: |
SCALA_VERSION=$(sed -nr 's/.*scalaVersion\s+:=\s+"(.*)"/\1/p' build.sbt)
METALS_SUPPORTED_VERSIONS=$(metals --version)
echo "$METALS_SUPPORTED_VERSIONS"
metals --version | grep "$SCALA_VERSION" || (echo "Scala $SCALA_VERSION not supported by metals."; false)
- name: Deploy to Github Pages
if: github.ref == 'refs/heads/main' && startsWith(matrix.scalaVersion, '2.13')
uses: JamesIves/github-pages-deploy-action@v4.6.1
with:
branch: gh-pages # The branch the action should deploy to.
folder: demo/target/scala-2.13/scalajs-bundler/main/dist # The folder the action should deploy.
# - name: Debug over SSH (tmate)
# # if: ${{ failure() }}
# uses: mxschmitt/action-tmate@v3
# with:
# limit-access-to-actor: true
publish:
needs: [build]
# if this is not a pull request, run only on main or tags pushes.
# if this is a pull request, run only when 'publish' label is set
if: (github.event_name != 'pull_request' && (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/v'))) ||
(github.event_name == 'pull_request' && contains(github.event.pull_request.labels.*.name, 'publish'))
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha }}
fetch-depth: 0 # full history with tags
- uses: coursier/cache-action@v6
- uses: coursier/setup-action@v1
with:
jvm: adoptium:1.17
apps: sbt
- uses: actions/setup-node@v4
with:
node-version: '16'
cache: 'yarn'
cache-dependency-path: formidable/package.json
- uses: olafurpg/setup-gpg@v3
- name: Publish
run: ENABLE_FATAL_WARNINGS=true SBT_OPTS="-XX:MaxHeapSize=6G" sbt version "git status" ci-release "git status"
env:
PGP_PASSPHRASE: ${{ secrets.PGP_PASSPHRASE }}
PGP_SECRET: ${{ secrets.PGP_SECRET }}
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }}