Skip to content

Commit

Permalink
NEXT-24838 - Add gh action for cachix
Browse files Browse the repository at this point in the history
  • Loading branch information
shyim committed Dec 27, 2022
1 parent 295c253 commit 78ecf92
Show file tree
Hide file tree
Showing 3 changed files with 59 additions and 14 deletions.
50 changes: 50 additions & 0 deletions .github/workflows/01-cachix.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: Cachix

on:
push:
branches:
- trunk
paths:
- devenv.nix
- devenv.yaml
- devenv.lock

permissions:
contents: read

jobs:
build:
strategy:
matrix:
os: [ubuntu-latest, macos-latest]
runs-on: ${{ matrix.os }}

steps:
- name: Clone
uses: actions/checkout@v3

- name: Install Nix
uses: cachix/install-nix-action@v18
with:
extra_nix_config: |
access-tokens = github.com=${{ secrets.GITHUB_TOKEN }}
- name: Use Devenv Cache
uses: cachix/cachix-action@v12
with:
name: devenv

- name: Use Shopware Cache
uses: cachix/cachix-action@v12
with:
name: shopware
authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}'

- name: Install Devenv
run: nix-env -if https://github.com/cachix/devenv/tarball/main

- name: Warmup cache
run: cachix watch-exec shopware devenv shell php -v
env:
NIXPKGS_ALLOW_UNFREE: 1

18 changes: 9 additions & 9 deletions devenv.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
"devenv": {
"locked": {
"dir": "src/modules",
"lastModified": 1671720732,
"narHash": "sha256-S+10HvZBqLINwuzepQujnhV9DERBkIJLmCNcVqcYG6g=",
"lastModified": 1672091025,
"narHash": "sha256-ApQIcAy8IV1Sc5Yv1iPAPVOlcNR2tMHsx4vkqQYnTjg=",
"owner": "cachix",
"repo": "devenv",
"rev": "88afd0d5423cabd1e2937ae26e8f6a3aed80b484",
"rev": "3a0dbd2d209b6e3730e51b675e9069bd68f4f662",
"type": "github"
},
"original": {
Expand Down Expand Up @@ -71,11 +71,11 @@
},
"nixpkgs": {
"locked": {
"lastModified": 1671728284,
"narHash": "sha256-u5Tlz4bl2vb9CB+L/A/Xp8F32062vo3K6yl7J9FBXdc=",
"lastModified": 1672057183,
"narHash": "sha256-GN7/10DNNvs1FPj9tlZA2qgNdFuYKKuS3qlHTqAxasQ=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "7ba7b4599367c07f2f5d1e26151b68a71a1336b2",
"rev": "b139e44d78c36c69bcbb825b20dbfa51e7738347",
"type": "github"
},
"original": {
Expand Down Expand Up @@ -112,11 +112,11 @@
"nixpkgs-stable": "nixpkgs-stable"
},
"locked": {
"lastModified": 1671452357,
"narHash": "sha256-HqzXiQEegpRQ4VEl9pEPgHSIxhJrNJ27HfN1wOc7w2E=",
"lastModified": 1672050129,
"narHash": "sha256-GBQMcvJUSwAVOpDjVKzB6D5mmHI7Y4nFw+04bnS9QrM=",
"owner": "cachix",
"repo": "pre-commit-hooks.nix",
"rev": "200790e9c77064c53eaf95805b013d96615ecc27",
"rev": "67d98f02443b9928bc77f1267741dcfdd3d7b65c",
"type": "github"
},
"original": {
Expand Down
5 changes: 0 additions & 5 deletions devenv.nix
Original file line number Diff line number Diff line change
@@ -1,11 +1,6 @@
{ pkgs, config, ... }:

{
enterShell = ''
rm -f .devenv/bin
ln -sf ${pkgs.buildEnv { name = "devenv"; paths = config.packages; ignoreCollisions = true; }}/bin .devenv/bin
'';

languages.javascript.enable = true;
languages.javascript.package = pkgs.nodejs-18_x;

Expand Down

0 comments on commit 78ecf92

Please sign in to comment.