diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 20d61b70e..695756e47 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -8,10 +8,25 @@ on: push: branches: [main] pull_request: + types: + - opened + - reopened + - synchronize + - ready_for_review + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +env: + USE_RUBY: ${{ vars.USE_RUBY || 'false' }} + USE_YQ: ${{ vars.USE_YQ || 'false' }} + USE_CACHE: ${{ vars.USE_CACHE || 'false' }} + CACHE_FOLDER: ${{ vars.CACHE_FOLDER || '.cache' }} jobs: test: - if: "!contains(github.event.head_commit.message, 'skip ci')" + if: ${{!contains(github.event.head_commit.message, 'skip ci') && !github.event.pull_request.draft}} runs-on: ubuntu-latest steps: - name: Checkout project (pull-request) @@ -28,10 +43,12 @@ jobs: with: java-version: adopt@1.11 - name: Setup Ruby + if: ${{ env.USE_RUBY == 'true' }} uses: ruby/setup-ruby@v1 with: ruby-version: .ruby-version - name: Setup yq + if: ${{ env.USE_YQ == 'true' }} run: sudo snap install yq - name: Run pre-conditions run: test -f .github/actions.yml && eval "$(yq e '.pre.ci // "true"' .github/actions.yml)" || true @@ -42,10 +59,26 @@ jobs: uses: stefanzweifel/git-auto-commit-action@v4.5.1 with: commit_message: Run formatter/linter + - name: Restore cache + id: ci-cache-restore + if: ${{ env.USE_CACHE == 'true' }} + uses: actions/cache/restore@v3 + with: + path: | + ${{ env.CACHE_FOLDER }} + key: ci-cache-key - name: Run checks run: sbt ci-test env: GITHUB_TOKEN: ${{ secrets.ADMIN_GITHUB_TOKEN }} + - name: Save cache + id: ci-cache-save + if: ${{ env.USE_CACHE == 'true' }} + uses: actions/cache/save@v3 + with: + path: | + ${{ env.CACHE_FOLDER }} + key: ${{ steps.ci-cache-restore.outputs.cache-primary-key }} - name: Run post-conditions run: test -f .github/actions.yml && eval "$(yq e '.post.ci // "true"' .github/actions.yml)" || true - name: Automerge Scala Steward PRs diff --git a/.gitignore b/.gitignore index 6b1e652d8..c35d6f7fb 100644 --- a/.gitignore +++ b/.gitignore @@ -35,8 +35,16 @@ project/plugins/project/ .bloop/ .metals/ metals.sbt + +### Scala-CLI ### + .scala-build/ +### Mill ### + +# Techinically a duplicate of the IDEA section. +out/ + ### Vim ### # Swap @@ -74,6 +82,13 @@ tags !.vscode/launch.json !.vscode/extensions.json -# Direnv +### Direnv ### .direnv +.envrc + +### JavaScript / NPM / Yarn / Bundlers ### + +node_modules +.parcel-cache +dist