Skip to content

Commit

Permalink
Use nix in github actions
Browse files Browse the repository at this point in the history
  • Loading branch information
eikek committed Mar 10, 2024
1 parent ef92e9e commit a535dd7
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 52 deletions.
20 changes: 3 additions & 17 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,37 +6,23 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: cachix/install-nix-action@v25
- uses: cachix/install-nix-action@v26
- run: nix build
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
4 changes: 4 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,10 @@
SHARRY_BACKEND_MAIL_SMTP_PASSWORD = "admin";
SHARRY_BACKEND_MAIL_SMTP_SSL__TYPE = "none";
};
ci = pkgs.mkShellNoCC {
buildInputs = ciPkgs;
SBT_OPTS = "-Xmx2G -Xss4m";
};
};
})
// {
Expand Down

0 comments on commit a535dd7

Please sign in to comment.