fugue / zim Goto Github PK
View Code? Open in Web Editor NEWA caching build system for teams using monorepos
License: Apache License 2.0
A caching build system for teams using monorepos
License: Apache License 2.0
I was trying to use ARTIFACTS_DIR
in the when.script_succeeds
part of the config, but it output an empty string.
deploy:
native: true
requires:
- rule: build
when:
script_succeeds:
with_output: NEEDS_UPDATE
run: ${ARTIFACTS_DIR}/../makedeps/component_diff.sh ${NAME}
commands:
- run: ${ARTIFACTS_DIR}/../makedeps/component_deploy.sh ${NAME}
Second ARTIFACTS_DIR
works, first does not.
Currently when.resource_exists
will throw an error if you pass it a directory. It would be helpful if this could just accept directories, so I could pass dist
or node_modules
to it. Workaround is to point to a known file.
It seems like this case is not handled correctly:
name: helloworld
rules:
build:
inputs:
- "hello.c"
outputs:
- ${NAME}
command: |
gcc hello.c
# Move the thing.
mv a.out ${OUTPUT}
The last line is not executed.
Runs a single command natively. Suggested syntax:
commands:
- nativerun [command]
This is similar in spirit to native: true
but would allow you to run single commands non-natively, rather than just single rules.
When using live-running process for Zim, it's always helpful to see output and debug info. Can we allow users to set a default for these settings in their ~/.zim
files.
Alternatively, it would be nice to set this on a per-rule basis? Live-reload rules are a lot less useful without the console info.
This request may be out-of-scope for Zim, but wanted to open the discussion anyways:
There are many cases where a live-reloading build is useful for development, but Zim seems to be more catered to producing build artifacts.
Ways this might work
rules:
build_livereload:
leave_open: true
native: true
commands:
- run: yarn && yarn start
build_livereload_all:
leave_open: true
requires:
- component: dependency
rule: build_livereload
- rule: build_livereload
Copies files/directories using cp
. Suggested syntax:
commands:
- copy
src: [src]
dest: [dest]
Moves files/directories using mv
. Suggested syntax:
commands:
- move
src: [src]
dest: [dest]
Unzips or unarchives the tar/zip created by zip
or archive
. Suggested syntax:
commands
- unzip
input:
output:
Possible option to do this conditionally, which would help out a lot for the "this folder needs to exist to build" use-cases:
commands
- unarchive
condition: ! -d "node_modules"
input: ../../artifacts/${NAME}.node_modules.tgz
output: .
If I have a list of inputs, and one of those inputs is not found, I'd like the rule to still run. The absence of that input should be treated as part of the cache key.
Use case: I'd like to use the same template for multiple components, but not all of those components have all of the files listed under inputs
.
ROOT
The root directory (where artifacts
lives). Useful to avoid having to do ../../artifacts
, etc, could just do ${ROOT}/artifacts
. ARTIFACTS_DIR
could also work? This will come into particular use since I'm intending on nesting packages, ie src/viz_packages/viz_renderer/component.yaml
and I'd like to avoid ../../../artifacts
, especially since that'll break if I later move them. Example rules where this would be useful:
Before
rules
dist:
requires:
- rule: build
native: true
command: |
if [ ! -d "dist" ]; then tar -zxf ../../artifacts/${NAME}.tgz; fi
clean:
commands:
- remove: dist
- remove: ../../artifacts/${NAME}.tgz
- remove: node_modules
- remove: ../../artifacts/${NAME}.node_modules.tgz
rules
dist:
requires:
- rule: build
native: true
command: |
if [ ! -d "dist" ]; then tar -zxf ${ROOT}/artifacts/${NAME}.tgz; fi
clean:
commands:
- remove: dist
- remove: ${ROOT}/artifacts/${NAME}.tgz
- remove: node_modules
- remove: ${ROOT}/artifacts/${NAME}.node_modules.tgz
For rules that are intended to spawn multiple open-ended processes (such as live-reloading rules), a certain level of concurrency is required, or they will break. Allow us to set a required_concurrency
parameter on a rule? Behavior could either be that it fails with a message if the zim config jobs
setting or the -j
flag is too low, or just bump it up to that number for that rule.
Alternative option is to just have a live: true
flag on rules that, when set, will automatically spawn that rule in its own process. This live: true
flag could maybe also turn on --output unbuffered
for that rule?
As far as i can tell from reading source/documentation zim currently only supports caching via S3.
Would you consider adding a local directory cache, which would allow for a very low friction setup for enabling caching in various environments.
It should be such that the full cache should be able to be exported/imported out of band, and thus be able to be loaded/saved from disk.
Immediate usage would be for using it with the default GitHub action cache pointed to by a simple directory path.
Thanks in advance ๐
I am looking into packaging zim for the scoop package manager for windows (https://scoop.sh/)
In order to do so, we would need to publish the following for new releases:
It would also be nice to have:
All of this could be achived using for example the GoReleaser Github Action: https://github.com/goreleaser/goreleaser-action
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.