Skip to content

Commit

Permalink
Update CI workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
Katrix committed Oct 17, 2023
1 parent 014bd6f commit 4c155d5
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 75 deletions.
46 changes: 8 additions & 38 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,38 +31,20 @@ jobs:
- 5432:5432

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4

- name: Set up NodeJS
uses: actions/setup-node@v3
with:
node-version: 16.16.0
cache: 'yarn'

- name: Set up JDK
uses: actions/setup-java@v1
uses: actions/setup-java@v3
with:
distribution: temurin
java-version: ${{ matrix.java }}

- name: Cache sbt Ivy cache
uses: actions/cache@v1
with:
path: ~/.ivy2/cache
key: ${{ runner.os }}-sbt-ivy-cache-${{ hashFiles('**.sbt', 'project/**/*.scala') }}
restore-keys: ${{ runner.os }}-sbt-ivy-cache

- name: Cache sbt Coursier cache
uses: actions/cache@v1
with:
path: ~/.cache/coursier
key: ${{ runner.os }}-sbt-coursier-cache-${{ hashFiles('**.sbt', 'project/**/*.scala') }}
restore-keys: ${{ runner.os }}-sbt-coursier-cache

- name: Cache sbt
uses: actions/cache@v1
with:
path: ~/.sbt
key: ${{ runner.os }}-sbt-${{ hashFiles('**.sbt', 'project/**/*.scala', 'project/build.properties') }}
restore-keys: ${{ runner.os }}-sbt
cache: sbt

- name: Initialize postgres extensions
env:
Expand Down Expand Up @@ -92,25 +74,13 @@ jobs:

name: Client Linting (Node ${{ matrix.node }})
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4

- name: Setup node
uses: actions/setup-node@v1
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node }}

- name: Get yarn cache directory path
id: yarn-cache-dir-path
working-directory: ${{env.client-dir}}
run: echo "::set-output name=dir::$(yarn cache dir)"

- uses: actions/cache@v1
id: yarn-cache
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-t
cache: 'yarn'

- name: Install dependencies
run: yarn install
Expand Down
74 changes: 37 additions & 37 deletions .github/workflows/scalafmt.yml
Original file line number Diff line number Diff line change
@@ -1,38 +1,38 @@
name: Scalafmt Check

on:
push:
paths:
- '**.scala'
- '**.sc'
- '**.sbt'
pull_request:
paths:
- '**.scala'
- '**.sc'
- '**.sbt'

jobs:
check:

runs-on: ubuntu-latest

env:
VERSION: 2.4.2

steps:
- uses: actions/checkout@v2

#- name: Cache Scalafmt native image
# id: cache
# uses: actions/cache@v1
# with:
# path: scalafmt-native
# key: ${{ runner.os }}-scalafmt-native-image-${{ hashFiles('scalafmt-native') }}

#- name: Download Scalafmt-native
# if: steps.cache.outputs.cache-hit != 'true'
# run: curl https://raw.githubusercontent.com/scalameta/scalafmt/master/bin/install-scalafmt-native.sh | bash -s -- $VERSION $GITHUB_WORKSPACE/scalafmt-native

- name: Check formatted
name: Scalafmt Check

on:
push:
paths:
- '**.scala'
- '**.sc'
- '**.sbt'
pull_request:
paths:
- '**.scala'
- '**.sc'
- '**.sbt'

jobs:
check:

runs-on: ubuntu-latest

env:
VERSION: 2.4.2

steps:
- uses: actions/checkout@v4

#- name: Cache Scalafmt native image
# id: cache
# uses: actions/cache@v1
# with:
# path: scalafmt-native
# key: ${{ runner.os }}-scalafmt-native-image-${{ hashFiles('scalafmt-native') }}

#- name: Download Scalafmt-native
# if: steps.cache.outputs.cache-hit != 'true'
# run: curl https://raw.githubusercontent.com/scalameta/scalafmt/master/bin/install-scalafmt-native.sh | bash -s -- $VERSION $GITHUB_WORKSPACE/scalafmt-native

- name: Check formatted
run: ./scalafmt --check --non-interactive

0 comments on commit 4c155d5

Please sign in to comment.