From 47044ad519a25552c6588c5439e8a4815dfeef12 Mon Sep 17 00:00:00 2001 From: Bruno Rodrigues Date: Thu, 11 Jul 2024 09:54:30 +0200 Subject: [PATCH] Create inst/default.nix in CI --- .github/workflows/make_inst_default.yaml | 39 ++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 .github/workflows/make_inst_default.yaml diff --git a/.github/workflows/make_inst_default.yaml b/.github/workflows/make_inst_default.yaml new file mode 100644 index 00000000..621d909f --- /dev/null +++ b/.github/workflows/make_inst_default.yaml @@ -0,0 +1,39 @@ +# Create inst/default.nix +on: + push: + branches: [main, master] + +name: create_inst_default.nix + +permissions: + contents: read, write + +jobs: + devtools: + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: ubuntu-latest + env: + GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} + + steps: + - uses: actions/checkout@v4 + + - name: Install Nix + uses: DeterminateSystems/nix-installer-action@main + + - name: Nix cache + uses: DeterminateSystems/magic-nix-cache-action@main + + - name: Build default.nix with 2 local packages + run: | + nix-shell ./inst/extdata/default.nix --run "Rscript -e \"library(rix);latest_commit <- tryCatch(expr = {sys::as_text(sys::exec_internal('git', c('rev-parse', 'master'))$stdout)}, error = function(e) '4d96207e7f69cbadca5349e9caa5bcc4059c1dc3');rix('4.3.1', git_pkgs = list(package_name = 'rix', repo_url = 'https://github.com/b-rodrigues/rix/', branch_name = 'master', commit = latest_commit), ide = 'other', project_path = ./inst/extdata, overwrite = TRUE)\"" + + - name: Commit and push default.nix + run: | + git config --global user.name 'CI Bot' + git config --global user.email 'ci-bot@users.noreply.github.com' + git add ./inst/extdata/default.nix + git commit -m "Updated default.nix" + git push origin master \ No newline at end of file