mirror of
https://github.com/dwinkler1/np.git
synced 2026-07-07 17:28:23 -04:00
Compare commits
No commits in common. "main" and "2.0.1" have entirely different histories.
9 changed files with 28 additions and 177 deletions
14
.github/workflows/check.yml
vendored
14
.github/workflows/check.yml
vendored
|
|
@ -1,6 +1,20 @@
|
||||||
name: "Test RDE template"
|
name: "Test RDE template"
|
||||||
on:
|
on:
|
||||||
workflow_dispatch: # allows manual triggering
|
workflow_dispatch: # allows manual triggering
|
||||||
|
push:
|
||||||
|
paths:
|
||||||
|
- 'templates/rde/flake.lock'
|
||||||
|
- 'templates/rde/**/*.nix'
|
||||||
|
- 'templates/rde/**/*.sh'
|
||||||
|
- 'templates/rde/**/*.lua'
|
||||||
|
- '.github/workflows/check.yml'
|
||||||
|
pull_request:
|
||||||
|
paths:
|
||||||
|
- 'templates/rde/flake.lock'
|
||||||
|
- 'templates/rde/**/*.nix'
|
||||||
|
- 'templates/rde/**/*.sh'
|
||||||
|
- 'templates/rde/**/*.lua'
|
||||||
|
- '.github/workflows/check.yml'
|
||||||
concurrency:
|
concurrency:
|
||||||
group: ${{ github.workflow }}-${{ github.ref }}
|
group: ${{ github.workflow }}-${{ github.ref }}
|
||||||
cancel-in-progress: true
|
cancel-in-progress: true
|
||||||
|
|
|
||||||
111
.github/workflows/check_ed.yml
vendored
111
.github/workflows/check_ed.yml
vendored
|
|
@ -1,16 +1,9 @@
|
||||||
name: "Test ed template"
|
name: "Test ed template MacOS"
|
||||||
on:
|
on:
|
||||||
workflow_dispatch:
|
workflow_dispatch: # allows manual triggering
|
||||||
push:
|
push:
|
||||||
paths:
|
branches:
|
||||||
- 'templates/ed/**'
|
- 'update_rde'
|
||||||
- 'tests/ed/**'
|
|
||||||
- '.github/workflows/check_ed.yml'
|
|
||||||
pull_request:
|
|
||||||
paths:
|
|
||||||
- 'templates/ed/**'
|
|
||||||
- 'tests/ed/**'
|
|
||||||
- '.github/workflows/check_ed.yml'
|
|
||||||
concurrency:
|
concurrency:
|
||||||
group: ${{ github.workflow }}-${{ github.ref }}
|
group: ${{ github.workflow }}-${{ github.ref }}
|
||||||
cancel-in-progress: true
|
cancel-in-progress: true
|
||||||
|
|
@ -19,105 +12,15 @@ jobs:
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
os: [ubuntu-latest]
|
os: [macos-latest, ubuntu-latest]
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v6
|
- uses: actions/checkout@v6
|
||||||
- uses: cachix/install-nix-action@v31
|
- uses: cachix/install-nix-action@v31
|
||||||
with:
|
with:
|
||||||
github_access_token: ${{ github.token }}
|
github_access_token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
- uses: cachix/cachix-action@v17
|
- uses: cachix/cachix-action@v17
|
||||||
with:
|
with:
|
||||||
name: rde
|
name: rde
|
||||||
authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}'
|
authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}'
|
||||||
extraPullNames: rstats-on-nix, nix-community
|
extraPullNames: rstats-on-nix, nix-community
|
||||||
|
- run: nix build ./templates/ed
|
||||||
- name: Build template
|
|
||||||
run: nix build ./templates/ed
|
|
||||||
|
|
||||||
- name: Test R script
|
|
||||||
env:
|
|
||||||
NO_NUSHELL: '1'
|
|
||||||
run: |
|
|
||||||
cd templates/ed
|
|
||||||
nix develop --command bash -c "Rscript ${{ github.workspace }}/tests/ed/test.R"
|
|
||||||
|
|
||||||
- name: Test Python script (disabled by default)
|
|
||||||
env:
|
|
||||||
NO_NUSHELL: '1'
|
|
||||||
run: |
|
|
||||||
cd templates/ed
|
|
||||||
nix develop --command bash -c "python3 ${{ github.workspace }}/tests/ed/test.py" || echo "SKIP: Python packages not enabled"
|
|
||||||
|
|
||||||
test-with-python:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v6
|
|
||||||
- uses: cachix/install-nix-action@v31
|
|
||||||
with:
|
|
||||||
github_access_token: ${{ github.token }}
|
|
||||||
- uses: cachix/cachix-action@v17
|
|
||||||
with:
|
|
||||||
name: rde
|
|
||||||
authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}'
|
|
||||||
extraPullNames: rstats-on-nix, nix-community
|
|
||||||
|
|
||||||
- name: Setup test directory with Python enabled
|
|
||||||
run: |
|
|
||||||
TEST_DIR=$(mktemp -d)
|
|
||||||
cp -r templates/ed/. "$TEST_DIR/"
|
|
||||||
cd "$TEST_DIR"
|
|
||||||
sed -i 's/python[[:space:]]*=[[:space:]]*false;/python = true;/' flake.nix
|
|
||||||
grep -q "python[[:space:]]*=[[:space:]]*true;" flake.nix || {
|
|
||||||
echo "Error: Failed to enable Python in flake.nix"
|
|
||||||
exit 1
|
|
||||||
}
|
|
||||||
echo "TEST_DIR=$TEST_DIR" >> $GITHUB_ENV
|
|
||||||
|
|
||||||
- name: Build with Python enabled
|
|
||||||
run: |
|
|
||||||
cd "$TEST_DIR"
|
|
||||||
nix build
|
|
||||||
|
|
||||||
- name: Test Python packages
|
|
||||||
env:
|
|
||||||
NO_NUSHELL: '1'
|
|
||||||
run: |
|
|
||||||
cd "$TEST_DIR"
|
|
||||||
nix develop --command bash -c "python3 ${{ github.workspace }}/tests/ed/test.py"
|
|
||||||
|
|
||||||
test-with-julia:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v6
|
|
||||||
- uses: cachix/install-nix-action@v31
|
|
||||||
with:
|
|
||||||
github_access_token: ${{ github.token }}
|
|
||||||
- uses: cachix/cachix-action@v17
|
|
||||||
with:
|
|
||||||
name: rde
|
|
||||||
authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}'
|
|
||||||
extraPullNames: rstats-on-nix, nix-community
|
|
||||||
|
|
||||||
- name: Setup test directory with Julia enabled
|
|
||||||
run: |
|
|
||||||
TEST_DIR=$(mktemp -d)
|
|
||||||
cp -r templates/ed/. "$TEST_DIR/"
|
|
||||||
cd "$TEST_DIR"
|
|
||||||
sed -i 's/julia[[:space:]]*=[[:space:]]*false;/julia = true;/' flake.nix
|
|
||||||
grep -q "julia[[:space:]]*=[[:space:]]*true;" flake.nix || {
|
|
||||||
echo "Error: Failed to enable Julia in flake.nix"
|
|
||||||
exit 1
|
|
||||||
}
|
|
||||||
echo "TEST_DIR=$TEST_DIR" >> $GITHUB_ENV
|
|
||||||
|
|
||||||
- name: Build with Julia enabled
|
|
||||||
run: |
|
|
||||||
cd "$TEST_DIR"
|
|
||||||
nix build
|
|
||||||
|
|
||||||
- name: Test Julia packages
|
|
||||||
env:
|
|
||||||
NO_NUSHELL: '1'
|
|
||||||
run: |
|
|
||||||
cd "$TEST_DIR"
|
|
||||||
# nix develop --command bash -c "julia ${{ github.workspace }}/tests/ed/test.jl"
|
|
||||||
|
|
|
||||||
3
.github/workflows/check_macos.yml
vendored
3
.github/workflows/check_macos.yml
vendored
|
|
@ -3,7 +3,7 @@ on:
|
||||||
workflow_dispatch: # allows manual triggering
|
workflow_dispatch: # allows manual triggering
|
||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
- 'update_ed'
|
- 'update_rde'
|
||||||
concurrency:
|
concurrency:
|
||||||
group: ${{ github.workflow }}-${{ github.ref }}
|
group: ${{ github.workflow }}-${{ github.ref }}
|
||||||
cancel-in-progress: true
|
cancel-in-progress: true
|
||||||
|
|
@ -23,4 +23,5 @@ jobs:
|
||||||
name: rde
|
name: rde
|
||||||
authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}'
|
authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}'
|
||||||
extraPullNames: rstats-on-nix, nix-community
|
extraPullNames: rstats-on-nix, nix-community
|
||||||
|
- run: nix build ./templates/rde
|
||||||
- run: nix build ./templates/ed
|
- run: nix build ./templates/ed
|
||||||
|
|
|
||||||
2
.github/workflows/update.yml
vendored
2
.github/workflows/update.yml
vendored
|
|
@ -26,7 +26,7 @@ jobs:
|
||||||
uses: DeterminateSystems/update-flake-lock@v28
|
uses: DeterminateSystems/update-flake-lock@v28
|
||||||
with:
|
with:
|
||||||
token: ${{ secrets.GH_TOKEN_FOR_UPDATES }}
|
token: ${{ secrets.GH_TOKEN_FOR_UPDATES }}
|
||||||
branch: update_ed
|
branch: update_rde
|
||||||
path-to-flake-dir: "templates/ed"
|
path-to-flake-dir: "templates/ed"
|
||||||
pr-title: "Update RDE flake.lock" # Title of PR to be created
|
pr-title: "Update RDE flake.lock" # Title of PR to be created
|
||||||
pr-labels: | # Labels to be set on the PR
|
pr-labels: | # Labels to be set on the PR
|
||||||
|
|
|
||||||
6
templates/ed/flake.lock
generated
6
templates/ed/flake.lock
generated
|
|
@ -22,11 +22,11 @@
|
||||||
},
|
},
|
||||||
"nixpkgs": {
|
"nixpkgs": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1779560665,
|
"lastModified": 1779357205,
|
||||||
"narHash": "sha256-tpyBcxPpcQb8ukyNF7DoCwfSY3VPsxHoYwj00Cayv5o=",
|
"narHash": "sha256-cCO8aTqss5x9Ky8GWkpY0Hy5fyTZEbtifSUV8QjSzic=",
|
||||||
"owner": "nixos",
|
"owner": "nixos",
|
||||||
"repo": "nixpkgs",
|
"repo": "nixpkgs",
|
||||||
"rev": "64c08a7ca051951c8eae34e3e3cb1e202fe36786",
|
"rev": "f83fc3c307e74bc5fd5adb7eb6b8b13ffd2a36e1",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
|
|
||||||
|
|
@ -131,9 +131,7 @@
|
||||||
shellHook =
|
shellHook =
|
||||||
nvimConfig.lib.shellHook evalResult.config
|
nvimConfig.lib.shellHook evalResult.config
|
||||||
+ ''
|
+ ''
|
||||||
if [ -z "''${NO_NUSHELL:-}" ]; then
|
exec nu
|
||||||
exec nu
|
|
||||||
fi
|
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -1,29 +0,0 @@
|
||||||
#!/usr/bin/env Rscript
|
|
||||||
|
|
||||||
packages <- c("arrow", "data.table", "fixest", "nvimcom")
|
|
||||||
failed <- character(0)
|
|
||||||
|
|
||||||
for (pkg in packages) {
|
|
||||||
ok <- tryCatch(
|
|
||||||
{
|
|
||||||
# nvimcom requires Neovim; skip loading but check it's installed
|
|
||||||
if (pkg == "nvimcom") {
|
|
||||||
requireNamespace(pkg, quietly = TRUE)
|
|
||||||
} else {
|
|
||||||
library(pkg, character.only = TRUE, quietly = TRUE)
|
|
||||||
}
|
|
||||||
TRUE
|
|
||||||
},
|
|
||||||
error = function(e) FALSE
|
|
||||||
)
|
|
||||||
if (!ok) {
|
|
||||||
failed <- c(failed, pkg)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (length(failed) > 0) {
|
|
||||||
cat(sprintf("FAIL: %s\n", paste(failed, collapse = ", ")))
|
|
||||||
quit(status = 1)
|
|
||||||
}
|
|
||||||
|
|
||||||
cat("PASS: all packages loaded\n")
|
|
||||||
|
|
@ -1,19 +0,0 @@
|
||||||
#!/usr/bin/env julia
|
|
||||||
|
|
||||||
packages = ["StatsBase"]
|
|
||||||
failed = String[]
|
|
||||||
|
|
||||||
for pkg in packages
|
|
||||||
try
|
|
||||||
@eval using $pkg
|
|
||||||
catch
|
|
||||||
push!(failed, pkg)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
if !isempty(failed)
|
|
||||||
@error "FAIL: $(join(failed, ", "))"
|
|
||||||
exit(1)
|
|
||||||
end
|
|
||||||
|
|
||||||
println("PASS: all packages loaded")
|
|
||||||
|
|
@ -1,17 +0,0 @@
|
||||||
#!/usr/bin/env python3
|
|
||||||
import sys
|
|
||||||
|
|
||||||
packages = ["requests"]
|
|
||||||
failed = []
|
|
||||||
|
|
||||||
for pkg in packages:
|
|
||||||
try:
|
|
||||||
__import__(pkg)
|
|
||||||
except ImportError:
|
|
||||||
failed.append(pkg)
|
|
||||||
|
|
||||||
if failed:
|
|
||||||
sys.stderr.write(f"FAIL: {', '.join(failed)}\n")
|
|
||||||
sys.exit(1)
|
|
||||||
|
|
||||||
print("PASS: all packages loaded")
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue