Skip to content

Build and populate cache #823

Build and populate cache

Build and populate cache #823

Workflow file for this run

name: Build and populate cache
on:
pull_request:
push:
branches:
- main
- master
schedule:
- cron: 15 5 * * *
jobs:
tests:
runs-on: ubuntu-latest
steps:
- name: Free disk space
uses: jlumbroso/[email protected]
with:
tool-cache: true
# https://github.com/jlumbroso/free-disk-space/issues/4
large-packages: false
- name: Checkout repository
uses: actions/checkout@v3
- name: Install nix
uses: cachix/install-nix-action@v22
with:
nix_path: nixpkgs=channel:nixpkgs-unstable
extra_nix_config: |
access-tokens = github.com=${{ secrets.GITHUB_TOKEN }}
keep-derivations = false
- name: Show nixpkgs version
run: nix-instantiate --eval -E '(import <nixpkgs> {}).lib.version'
- name: Setup cachix
uses: cachix/cachix-action@v12
with:
name: bandithedoge
signingKey: ${{ secrets.CACHIX_SIGNING_KEY }}
authToken: ${{ secrets.CACHIX_AUTH_TOKEN }}
extraPullNames: berberman
- name: Update sources
run: |
nix flake update
echo -e '[keys]\ngithub = "${{ secrets.GITHUB_TOKEN }}"' > keyfile.toml
nix run "github:berberman/nvfetcher" -- -k keyfile.toml -l CHANGELOG -t
rm keyfile.toml
- name: Update vim plugins
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
cd pkgs/vimPlugins/
nix run "nixpkgs#niv" -- update
chmod +x update_list.py && ./update_list.py
- name: Update Node packages
run: |
cd pkgs/nodePackages/node2nix
nix run "nixpkgs#node2nix" -- -i node-packages.json
- name: Update Firefox addons
run: |
cd pkgs/firefoxAddons
nix run "sourcehut:~rycee/mozilla-addons-to-nix" -- addons.json generated.nix
- name: Format code
run: nix fmt
- name: Check evaluation
run: |
nix-env -f . -qa \* --meta --xml \
--option allow-import-from-derivation true \
--drv-path --show-trace \
-I nixpkgs="$(nix-instantiate --find-file nixpkgs)" \
-I "$PWD"
- name: Build nix packages
run: nix shell -f '<nixpkgs>' nix-build-uncached -c nix-build-uncached ci.nix -A cacheOutputs --show-trace
- name: Commit changes
uses: EndBug/add-and-commit@v9
with:
default_author: github_actions
message: Update sources
- name: Trigger NUR update
run: curl -XPOST "https://nur-update.herokuapp.com/update?repo=bandithedoge"