Skip to content

Commit

Permalink
use flake.nix for CI
Browse files Browse the repository at this point in the history
  • Loading branch information
ubbabeck committed Jan 30, 2024
1 parent 2f9dc4d commit 33ad346
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 36 deletions.
76 changes: 41 additions & 35 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -101,12 +101,13 @@ jobs:
steps:
- name: Checkout repo
uses: actions/checkout@v3

# Set up the flutter environment and run checks
- uses: subosito/flutter-action@v2
with:
flutter-version: '3.13.9'
channel: 'stable'

- name: Install nix

uses: nixbuild/nix-quick-install-action@v26
- name: Run nix develop
working-directory: snippets/dart_snippets
run: nix develop

- uses: actions/download-artifact@v3
with:
Expand All @@ -130,11 +131,11 @@ jobs:
steps:
- name: Checkout repo
uses: actions/checkout@v3

- name: Setup dotnet
uses: actions/setup-dotnet@v3
with:
dotnet-version: '7.0.x'
- name: Install nix
uses: nixbuild/nix-quick-install-action@v26
- name: Run nix develop
working-directory: snippets/csharp
run: nix develop

- name: Download archived package
uses: actions/download-artifact@v3
Expand Down Expand Up @@ -167,10 +168,12 @@ jobs:
- name: Checkout repo
uses: actions/checkout@v3

- name: Set Node.js 20.x
uses: actions/setup-node@v3
with:
node-version: 20.x
- name: Install nix
uses: nixbuild/nix-quick-install-action@v26

- name: Run nix develop
working-directory: snippets/react-native
run: nix develop

- name: Download archived package
uses: actions/download-artifact@v3
Expand Down Expand Up @@ -199,11 +202,12 @@ jobs:
steps:
- name: Checkout repo
uses: actions/checkout@v3

- uses: actions/setup-go@v4
with:
go-version: '1.21'

- name: Install nix
uses: nixbuild/nix-quick-install-action@v26
- name: Run nix develop
working-directory: snippets/go
run: nix develop

- name: Download archived package
uses: actions/download-artifact@v3
with:
Expand Down Expand Up @@ -234,19 +238,22 @@ jobs:
go build .
check-python:
needs:
- build-packages
needs:
- build-packages

name: Check Python snippets
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.8'

- name : Install nix
uses: nixbuild/nix-quick-install-action@v26

- name: Run nix develop
working-directory: snippets/go
run: nix develop

- name: Download archived package
uses: actions/download-artifact@v3
with:
Expand Down Expand Up @@ -292,17 +299,16 @@ jobs:
name: Check kotlin MPP snippets
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v3
- name: Checkout repo
uses: actions/checkout@v3

- name: Set up Java 17
uses: actions/setup-java@v2
with:
distribution: "temurin"
java-version: 17
- name : Install nix
uses: nixbuild/nix-quick-install-action@v26
- working-directory: snippets/kotlin_mpp_lib
run: nix develop


- name: Compile Kotlin
working-directory: snippets/kotlin_mpp_lib
run: |
./gradlew build
Expand Down
1 change: 1 addition & 0 deletions snippets/kotlin_mpp_lib/flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
in
{
devShells.default = pkgs.mkShell {
# TODO make gradle use java17 by default.
buildInputs = with pkgs; [
kotlin
ktlint
Expand Down
3 changes: 2 additions & 1 deletion snippets/python/flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@
{
devShells.default = pkgs.mkShell {
buildInputs = with pkgs; [
python3
python311Full
python311Packages.pip
ruff
];
};
Expand Down

0 comments on commit 33ad346

Please sign in to comment.