From 4c155d5462f7d1baffc4ec5042341426512031c1 Mon Sep 17 00:00:00 2001 From: Katrix Date: Tue, 17 Oct 2023 15:29:24 +0200 Subject: [PATCH] Update CI workflows --- .github/workflows/main.yml | 46 ++++----------------- .github/workflows/scalafmt.yml | 74 +++++++++++++++++----------------- 2 files changed, 45 insertions(+), 75 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 1390e94cf..fa13199d3 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -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: @@ -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 diff --git a/.github/workflows/scalafmt.yml b/.github/workflows/scalafmt.yml index c3e35131f..d9b6e22ed 100644 --- a/.github/workflows/scalafmt.yml +++ b/.github/workflows/scalafmt.yml @@ -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 \ No newline at end of file