1
0
Fork 0
mirror of https://code.forgejo.org/forgejo/runner.git synced 2025-08-11 17:50:58 +00:00
Commit graph

27 commits

Author SHA1 Message Date
Mike Beaumont
3be0bb5266 fix: fromJSON should work with any JSON (#883)
* test: fromJSON should work with arrays

* fix: fromJSON should work with any JSON
2021-11-15 14:26:04 +00:00
ChristopherHX
65f74c5c50 Fix format function {{, }} are escapes (#752)
* Fix format function {{, }} are escapes

Added some tests for some corner cases

* Update format function added 2 error checks
2021-08-09 15:19:10 +00:00
ChristopherHX
f5835d4e56 Fix defaults (composite) (#753)
* Fix defaults (composite)

* uses-composite: rely on defaults to pass

* Add test_input_required back, needs more tests

* Update Tests to test defaults carefully
2021-07-21 13:50:43 +00:00
Phil Story
5ed5bc15b3 Add needs job output (#629)
* Add outputs field to job model

* Add output interpolation for jobs

* Add otto config reference for interpolated job output values into 'needs' context

* Add output interpolation call after job has completed.

* gofmt

* Remove whitespace

* goimports

Co-authored-by: Casey Lee <cplee@nektos.com>
2021-07-01 15:20:20 +00:00
hackercat
86fdd6428d Fix tests on Windows (#562)
* fix: replace `\` with `/` in git ref to fix `git_test.go` on windows

Paths on Windows use backslash (`\`) as directory separator and this breaks `TestGitFindRef()`.
Replacing `\` with `/` in git ref fixes that issue.

* fix: replace `gopkg.in/godo.v2/glob` with std library `path/filepath`

`github.com/go-godo/godo` lib has been last updated in 2016 and it also
depends on another outdated lib `github.com/MichaelTJones/walk` with
last update in 2016. This also fixes `permission_denied` errors on
Windows (and perhaps Linux in some specific cases). I'm not aware of
any performance improvement or drawback because of that change.
2021-03-12 16:23:03 -08:00
KADOTA, Kyohei
29d21f7796 Shouldn't rewrite dot in a string to index syntax (#502)
Co-authored-by: Casey Lee <cplee@nektos.com>
2021-02-08 09:14:12 -08:00
Cat™
30dc143809 Interpolate with: inputs (#511) 2021-01-30 17:43:11 -08:00
KADOTA, Kyohei
035108c9f1 Format sources with gofmt (#472)
Co-authored-by: Casey Lee <cplee@nektos.com>
2021-01-14 21:37:38 -08:00
Cat™
078494e07c Make all secrets case insensitive by formatting them to uppercase (#470)
* Uppercase secrets, print error when secret with same name already exists

* Test lower-to-upper case formatting for secrets
2021-01-12 09:54:53 -08:00
Torbjørn Vatn
1ae5c19aa4 EvalBool and Interpolation fixes (#424)
* A new attempt at Interpolation and EvalBool

* One small merge fix

* Remove some fmt.Printfs
2020-11-17 09:31:05 -08:00
Torbjørn Vatn
d752f1e2b9 envs in if: - take 2 (#412)
* Test more if env variants

* The correct negation syntax is !=

* Make the Interpolate function support negated booleans from envs

* Move assert := a.New(t) into t.Run

This uncovered that some of the test premisses was wrong and the
Eval Bool function also had flaws

* Remove a stray logrus import
2020-11-12 08:15:09 -08:00
Peter Tissen
4b00c2754d Add variadic version of hashFiles (#411) 2020-11-09 09:08:57 -08:00
Owen
8d723eb376 feat: add fromJSON support (#352) 2020-09-01 13:55:29 -07:00
Denys Vitali
e37c3699ff fix: add default values in vmInput 2020-07-20 21:17:49 +02:00
Ayaz BADOURALY
f4dcbab826 Rewrite contexts before evaluating them (#287)
* Rewrite contexts before evaluating them

* Precompile context and expression patterns

* Test trim before rewrite

The current contextPattern is quite constraining and would fail the
rewrite of a context with trailing spaces. Triming happens during the
execution of Interpolate, and these tests aim to detect future breaking
changes on this behavior.

Co-authored-by: Casey Lee <cplee@nektos.com>
2020-06-24 07:08:45 -07:00
Josh Soref
72c3bf2220 Spelling (#240)
* spelling: cartesian

* spelling: deferring

* spelling: marshal
2020-05-18 09:53:42 -07:00
Torbjørn Vatn
09c4c76744 Make envs available in if conditionals (#225)
* Ignore .idea

* Add Env to the RunContext vm so we can Evaluate and Interpolate `env.xx`

* Make EvalBool support expressions more in line with the github runner

* Turns out Boolean(value) is what github is doing after all

* Add test for github context as well
2020-05-04 12:18:13 -07:00
Casey Lee
e3ad34295b support nested expressions 2020-03-12 17:22:33 -07:00
Casey Lee
8f6d32db71 fix #134 - support 'env' context in steps 2020-03-06 13:39:01 -08:00
Casey Lee
33561d42d3 fix #115 - support toJson and toJSON (#116) 2020-02-28 15:20:31 -08:00
Casey Lee
e7515df4b1 fix #108 - support matrix expressions in job name (#109) 2020-02-26 23:29:43 -08:00
Casey Lee
0f6340f811 cache dir for remote actions 2020-02-23 22:34:48 -08:00
Casey Lee
12ac7300b9 shared container for job 2020-02-23 15:01:25 -08:00
Casey Lee
0094b96051 support for secrets
Signed-off-by: Casey Lee <cplee@nektos.com>
2020-02-20 21:06:09 -05:00
Casey Lee
b8589c4e9b initial support for expressons
Signed-off-by: Casey Lee <cplee@nektos.com>
2020-02-20 21:05:59 -05:00
Casey Lee
7183c74cd0 fix tests
Signed-off-by: Casey Lee <cplee@nektos.com>
2020-02-20 21:05:57 -05:00
Casey Lee
e67e06809c expressions working
Signed-off-by: Casey Lee <cplee@nektos.com>
2020-02-20 21:05:55 -05:00