-
Notifications
You must be signed in to change notification settings - Fork 2
79 lines (66 loc) · 2.17 KB
/
Copy pathci.yml
File metadata and controls
79 lines (66 loc) · 2.17 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
name: CI Build and Test
on:
push:
branches:
- main
- cicd
pull_request:
branches:
- main
workflow_run:
workflows: ["Build and Push CI Docker Image"]
types:
- completed
env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}-ci
jobs:
compile:
runs-on: ubuntu-latest
container:
image: ghcr.io/${{ github.repository }}-ci:latest
credentials:
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
env:
# The image already provides the venv, so dimwit must not try to `uv sync` on top of it.
DIMWIT_SKIP_SYNC: "true"
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Cache SBT dependencies
uses: actions/cache@v4
with:
path: |
~/.sbt
~/.ivy2/cache
~/.cache/coursier
key: ${{ runner.os }}-sbt-${{ hashFiles('**/build.sbt', 'project/**') }}
restore-keys: |
${{ runner.os }}-sbt-
# TEMPORARY: dimwit 0.2-SNAPSHOT is not published to any remote yet, so CI builds it from
- name: Check out dimwit
uses: actions/checkout@v4
with:
repository: dimwit-dev/dimwit
ref: main
path: dimwit
# The version is pinned here to what build.sbt depends on, so a version bump on dimwit's
# main cannot silently leave this build resolving a stale snapshot.
- name: Publish dimwit-core to the local ivy repo
working-directory: dimwit
run: sbt publishLocal
- name: Check formatting
run: sbt scalafmtCheckAll
- name: Compile core module
run: sbt "project core" compile
# `examples` depends on plotwit, which is not published yet, so it cannot be built
# on a runner. Re-enable this once plotwit is available from a remote resolver.
# - name: Compile examples module
# run: sbt "project examples" compile
- name: Check unused imports (scalafix)
run: sbt "core/scalafixAll --check"
- name: Check if docsRoot is up to date
run: sbt "docsRoot/mdoc --check"
- name: Run tests
run: sbt core/test