Skip to content

Commit

Permalink
Merge pull request #1351 from eikek/nix-refactor
Browse files Browse the repository at this point in the history
Nix refactor and build update
  • Loading branch information
mergify[bot] authored Mar 10, 2024
2 parents 61e9a2c + bb130a3 commit 9b264b6
Show file tree
Hide file tree
Showing 25 changed files with 344 additions and 810 deletions.
23 changes: 5 additions & 18 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,40 +3,27 @@ on:
pull_request:
jobs:
nix-build:
if: false
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: cachix/install-nix-action@v25
- run: nix build
- uses: cachix/install-nix-action@v26
- run: nix build .#sharry-dev
ci-matrix:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
java: [ '[email protected]' ]
steps:
- uses: actions/[email protected]
with:
fetch-depth: 100
- uses: jorelali/setup-elm@v5
with:
elm-version: 0.19.1
- uses: bahmutov/npm-install@v1
with:
working-directory: modules/webapp
- uses: cachix/install-nix-action@v25
- name: Install tailwindcss cli
run: |
nix profile install nixpkgs#tailwindcss
- uses: cachix/install-nix-action@v26
- name: Fetch tags
run: git fetch --depth=100 origin +refs/tags/*:refs/tags/*
- uses: olafurpg/setup-scala@v14
with:
java-version: ${{ matrix.java }}
- name: Coursier cache
uses: coursier/cache-action@v6
- name: sbt ci ${{ github.ref }}
run: sbt ci
run: nix develop .#ci --command sbt ci
ci:
runs-on: ubuntu-22.04
needs: [ci-matrix]
Expand Down
20 changes: 3 additions & 17 deletions .github/workflows/release-nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,33 +8,19 @@ jobs:
runs-on: ubuntu-22.04
strategy:
fail-fast: true
matrix:
java: [ '[email protected]' ]
steps:
- uses: actions/[email protected]
with:
fetch-depth: 0
- uses: olafurpg/setup-scala@v14
with:
java-version: ${{ matrix.java }}
- uses: jorelali/setup-elm@v5
with:
elm-version: 0.19.1
- uses: bahmutov/npm-install@v1
with:
working-directory: modules/webapp
- uses: cachix/install-nix-action@v25
- name: Install tailwindcss cli
run: |
nix profile install nixpkgs#tailwindcss
- uses: cachix/install-nix-action@v26
- name: Coursier cache
uses: coursier/cache-action@v6
- name: Set current version
run: echo "SHARRY_VERSION=$(cat version.sbt | grep version | cut -d= -f2 | xargs)" >> $GITHUB_ENV
- name: sbt ci ${{ github.ref }}
run: sbt ci
run: nix develop .#ci --command sbt ci
- name: sbt make-pkg (${{ env.SHARRY_VERSION }})
run: sbt make-pkg
run: nix develop .#ci --command sbt make-pkg
- uses: "marvinpinto/action-automatic-releases@latest"
with:
repo_token: "${{ secrets.GITHUB_TOKEN }}"
Expand Down
13 changes: 1 addition & 12 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,27 +8,16 @@ jobs:
runs-on: ubuntu-22.04
strategy:
fail-fast: true
matrix:
java: [ '[email protected]' ]
steps:
- uses: actions/[email protected]
with:
fetch-depth: 0
- uses: olafurpg/setup-scala@v14
with:
java-version: ${{ matrix.java }}
- uses: jorelali/setup-elm@v5
with:
elm-version: 0.19.1
- uses: bahmutov/npm-install@v1
with:
working-directory: modules/webapp
- name: Coursier cache
uses: coursier/cache-action@v6
- name: Set current version
run: echo "SHARRY_VERSION=$(cat version.sbt | grep version | cut -d= -f2 | xargs)" >> $GITHUB_ENV
- name: sbt make-pkg (${{ env.SHARRY_VERSION }})
run: sbt make-pkg
run: nix develop .#ci --command sbt make-pkg
- uses: meeDamian/[email protected]
with:
token: ${{ secrets.GITHUB_TOKEN }}
Expand Down
8 changes: 2 additions & 6 deletions .github/workflows/website.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,9 @@ jobs:
fetch-depth: 0
- name: Set current version
run: echo "SHARRY_VERSION=$(cat version.sbt | grep version | cut -d= -f2 | xargs)" >> $GITHUB_ENV
- uses: cachix/install-nix-action@6004951b182f8860210c8d6f0d808ec5b1a33d28 # v25
with:
nix_path: nixpkgs=channel:nixos-21.05
- name: Print nixpkgs version
run: nix-instantiate --eval -E '(import <nixpkgs> {}).lib.version'
- uses: cachix/install-nix-action@26
- name: Build website (${{ env.SHARRY_VERSION }})
run: nix-shell project/microsite.nix --run "sbt microsite/makeMicrosite"
run: nix develop .#ci --command sbt microsite/makeMicrosite
- name: Publish website (${{ env.SHARRY_VERSION }})
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand Down
7 changes: 5 additions & 2 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@ val webjarSkip = settingKey[Boolean]("Skip copying webjar files")

val scalafixSettings = Seq(
semanticdbEnabled := true, // enable SemanticDB
semanticdbVersion := scalafixSemanticdb.revision, // "4.4.0"
ThisBuild / scalafixDependencies ++= Dependencies.organizeImports
semanticdbVersion := scalafixSemanticdb.revision
)

val sharedSettings = Seq(
Expand Down Expand Up @@ -192,6 +191,10 @@ val restapi = project
openapiPackage := Pkg("sharry.restapi.model"),
openapiSpec := (Compile / resourceDirectory).value / "sharry-openapi.yml",
openapiStaticGen := OpenApiDocGenerator.Redoc,
openapiRedoclyCmd := Seq("redocly-cli"),
openapiRedoclyConfig := Some(
(LocalRootProject / baseDirectory).value / "project" / "redocly.yml"
),
openapiScalaConfig := ScalaConfig()
.withJson(ScalaJson.circeSemiauto)
.addMapping(CustomMapping.forType { case TypeDef("LocalDateTime", _) =>
Expand Down
81 changes: 75 additions & 6 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 9b264b6

Please sign in to comment.