Format yaml for workflow
This commit is contained in:
+61
-62
@@ -14,80 +14,79 @@ jobs:
|
|||||||
env:
|
env:
|
||||||
NIX_PATH: nixpkgs=channel:nixpkgs-unstable
|
NIX_PATH: nixpkgs=channel:nixpkgs-unstable
|
||||||
steps:
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v3
|
||||||
|
|
||||||
- name: Checkout
|
- name: Setup Node.js
|
||||||
uses: actions/checkout@v3
|
uses: actions/setup-node@v3.4.1
|
||||||
|
with:
|
||||||
|
node-version: 16.x
|
||||||
|
|
||||||
- name: Setup Node.js
|
- name: Yarn cache
|
||||||
uses: actions/setup-node@v3.4.1
|
uses: actions/cache@v3
|
||||||
with:
|
with:
|
||||||
node-version: 16.x
|
path: .yarn/cache
|
||||||
|
key: yarn-${{ hashFiles('yarn.lock') }}
|
||||||
|
restore-keys: yarn-
|
||||||
|
|
||||||
- name: Yarn cache
|
- name: Yarn install
|
||||||
uses: actions/cache@v3
|
run: yarn install --immutable
|
||||||
with:
|
|
||||||
path: .yarn/cache
|
|
||||||
key: yarn-${{ hashFiles('yarn.lock') }}
|
|
||||||
restore-keys: yarn-
|
|
||||||
|
|
||||||
- name: Yarn install
|
- name: TypeScript
|
||||||
run: yarn install --immutable
|
run: yarn check
|
||||||
|
|
||||||
- name: TypeScript
|
- name: Build
|
||||||
run: yarn check
|
run: yarn build
|
||||||
|
|
||||||
- name: Build
|
- name: Update dist
|
||||||
run: yarn build
|
if: github.repository_owner == 'stephank' && github.ref == 'refs/heads/main'
|
||||||
|
run: |
|
||||||
|
if [[ "$(git status --porcelain)" != "" ]]; then
|
||||||
|
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
|
||||||
|
git config user.name "github-actions[bot]"
|
||||||
|
git commit -m 'Update dist' dist/yarn-plugin-nixify.js
|
||||||
|
git push
|
||||||
|
fi
|
||||||
|
|
||||||
- name: Update dist
|
- name: Install plugin
|
||||||
if: github.repository_owner == 'stephank' && github.ref == 'refs/heads/main'
|
run: yarn plugin import ./dist/yarn-plugin-nixify.js
|
||||||
run: |
|
|
||||||
if [[ "$(git status --porcelain)" != "" ]]; then
|
|
||||||
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
|
|
||||||
git config user.name "github-actions[bot]"
|
|
||||||
git commit -m 'Update dist' dist/yarn-plugin-nixify.js
|
|
||||||
git push
|
|
||||||
fi
|
|
||||||
|
|
||||||
- name: Install plugin
|
- name: Test without Nix
|
||||||
run: yarn plugin import ./dist/yarn-plugin-nixify.js
|
run: yarn
|
||||||
|
|
||||||
- name: Test without Nix
|
- name: Install Nix
|
||||||
run: yarn
|
uses: nixbuild/nix-quick-install-action@v17
|
||||||
|
|
||||||
- name: Install Nix
|
- name: Setup Cachix
|
||||||
uses: nixbuild/nix-quick-install-action@v17
|
if: github.event_name == 'push' && github.repository_owner == 'stephank'
|
||||||
|
uses: cachix/cachix-action@v10
|
||||||
|
with:
|
||||||
|
name: stephank
|
||||||
|
signingKey: "${{ secrets.CACHIX_SIGNING_KEY }}"
|
||||||
|
|
||||||
- name: Setup Cachix
|
- name: Test with Nix
|
||||||
if: github.event_name == 'push' && github.repository_owner == 'stephank'
|
run: yarn
|
||||||
uses: cachix/cachix-action@v10
|
|
||||||
with:
|
|
||||||
name: stephank
|
|
||||||
signingKey: '${{ secrets.CACHIX_SIGNING_KEY }}'
|
|
||||||
|
|
||||||
- name: Test with Nix
|
- name: Test nix-build
|
||||||
run: yarn
|
run: nix-build
|
||||||
|
|
||||||
- name: Test nix-build
|
# TODO: Check there really is a separate derivation,
|
||||||
run: nix-build
|
# and that Yarn actually reuses the build.
|
||||||
|
- name: Test isolated builds
|
||||||
|
run: |
|
||||||
|
# Matches example in ISOLATED_BUILDS.md
|
||||||
|
echo 'isolatedNixBuilds: ["sqlite3"]' >> .yarnrc.yml
|
||||||
|
cat > default.nix << EOF
|
||||||
|
{ pkgs ? import <nixpkgs> { } }:
|
||||||
|
|
||||||
# TODO: Check there really is a separate derivation,
|
pkgs.callPackage ./yarn-project.nix { } {
|
||||||
# and that Yarn actually reuses the build.
|
src = ./.;
|
||||||
- name: Test isolated builds
|
overrideSqlite3Attrs = old: {
|
||||||
run: |
|
npm_config_sqlite = "/"; # Don't accidentally use the wrong sqlite.
|
||||||
# Matches example in ISOLATED_BUILDS.md
|
buildInputs = old.buildInputs ++ (with pkgs; [ python3 sqlite ]);
|
||||||
echo 'isolatedNixBuilds: ["sqlite3"]' >> .yarnrc.yml
|
};
|
||||||
cat > default.nix << EOF
|
}
|
||||||
{ pkgs ? import <nixpkgs> { } }:
|
EOF
|
||||||
|
|
||||||
pkgs.callPackage ./yarn-project.nix { } {
|
yarn add sqlite3
|
||||||
src = ./.;
|
nix-build
|
||||||
overrideSqlite3Attrs = old: {
|
|
||||||
npm_config_sqlite = "/"; # Don't accidentally use the wrong sqlite.
|
|
||||||
buildInputs = old.buildInputs ++ (with pkgs; [ python3 sqlite ]);
|
|
||||||
};
|
|
||||||
}
|
|
||||||
EOF
|
|
||||||
|
|
||||||
yarn add sqlite3
|
|
||||||
nix-build
|
|
||||||
|
|||||||
Reference in New Issue
Block a user