diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..5ace460 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,6 @@ +version: 2 +updates: + - package-ecosystem: "github-actions" + directory: "/" + schedule: + interval: "weekly" diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..8f9207e --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,56 @@ +name: "Build and populate cache" +on: + pull_request: + push: + schedule: + # rebuild everyday at 2:51 + # TIP: Choose a random time here so not all repositories are build at once: + # https://www.random.org/clock-times/?num=1&earliest=01%3A00&latest=08%3A00&interval=5&format=html&rnd=new + - cron: '51 2 * * *' +jobs: + tests: + strategy: + matrix: + # Set this to notify the global nur package registry that changes are + # available. + # + # The repo name as used in + # https://github.com/nix-community/NUR/blob/master/repos.json + nurRepo: + - + # Set this to cache your build results in cachix for faster builds + # in CI and for everyone who uses your cache. + # + # Format: Your cachix cache host name without the ".cachix.org" suffix. + # Example: mycache (for mycache.cachix.org) + # + # For this to work, you also need to set the CACHIX_SIGNING_KEY secret + # in your repository settings in Github found at https://github.com//nur-packages/settings/secrets + cachixName: + - + nixPath: + - nixpkgs=channel:nixos-unstable + - nixpkgs=channel:nixpkgs-unstable + - nixpkgs=channel:nixos-20.03 + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v2.3.1 + - name: Install nix + uses: cachix/install-nix-action@v10 + with: + nix_path: "${{ matrix.nixPath }}" + - name: Show nixpkgs version + run: nix-instantiate --eval -E '(import {}).lib.version' + - name: Setup cachix + uses: cachix/cachix-action@v6 + if: ${{ matrix.cachixName != '' }} + with: + name: ${{ matrix.cachixName }} + signingKey: '${{ secrets.CACHIX_SIGNING_KEY }}' + - name: Build nix packages + # TODO switch to default nixpkgs channel once nix-build-uncached 1.0.0 is in stable + run: nix run -I 'nixpkgs=channel:nixos-unstable' nixpkgs.nix-build-uncached -c nix-build-uncached ci.nix -A cacheOutputs + - name: Trigger NUR update + if: ${{ matrix.nurRepo != '' }} + run: curl -XPOST "https://nur-update.herokuapp.com/update?repo=${{ matrix.nurRepo }}" diff --git a/README.md b/README.md index e719544..d543d44 100644 --- a/README.md +++ b/README.md @@ -10,11 +10,11 @@ * Remember to mark the broken packages as `broken = true;` in the `meta` attribute, or travis (and consequently caching) will fail! * Library functions, modules and overlays go in the respective directories -3. Add your NUR repo name and your cachix repo name (optional) to - [.travis.yml](./.travis.yml) -4. Enable travis for your repo - * You can add a cron job in the repository settings on travis to keep your - cachix cache fresh +3. Choose your CI: Depending on your preference you can use github actions (recommended) or [Travis ci](https://travis-ci.com). + - Github actions: Change your NUR repo name and optionally add a cachix name in [.github/workflows/build.yml](./.github/workflows/build.yml) and change the cron timer + to a random value as described in the file + - Travis ci: Change your NUR repo name and optionally your cachix repo name in + [.travis.yml](./.travis.yml). Than enable travis in your repo. You can add a cron job in the repository settings on travis to keep your cachix cache fresh 5. Change your travis and cachix names on the README template section and delete the rest 6. [Add yourself to NUR](https://github.com/nix-community/NUR#how-to-add-your-own-repository) @@ -25,7 +25,13 @@ **My personal [NUR](https://github.com/nix-community/NUR) repository** + +![Build and populate cache](https://github.com/nix-community//workflows/Build%20and%20populate%20cache/badge.svg) + + [![Cachix Cache](https://img.shields.io/badge/cachix--blue.svg)](https://.cachix.org) -