mirror of
https://codeberg.org/guix/guix.git
synced 2025-10-02 02:15:12 +00:00
import/github: Test it.
* Makefile.am (SCM_TESTS): Register new tests. * guix/import/github.scm (%github-api): New variable. (fetch-releases-or-tags): Use the new variable. * tests/import-github.scm: New file with tests. Signed-off-by: Ludovic Courtès <ludo@gnu.org>
This commit is contained in:
parent
f8306a5019
commit
81f036bfd2
3 changed files with 146 additions and 3 deletions
|
@ -39,7 +39,10 @@
|
|||
#:use-module (guix upstream)
|
||||
#:use-module (guix http-client)
|
||||
#:use-module (web uri)
|
||||
#:export (%github-updater))
|
||||
#:export (%github-api %github-updater))
|
||||
|
||||
;; For tests.
|
||||
(define %github-api (make-parameter "https://api.github.com"))
|
||||
|
||||
(define (find-extension url)
|
||||
"Return the extension of the archive e.g. '.tar.gz' given a URL, or
|
||||
|
@ -150,11 +153,11 @@ tags show up in the \"Releases\" tab of the web UI. For instance,
|
|||
'https://api.github.com/repos/aconchillo/guile-json/releases' returns the
|
||||
empty list."
|
||||
(define release-url
|
||||
(string-append "https://api.github.com/repos/"
|
||||
(string-append (%github-api) "/repos/"
|
||||
(github-user-slash-repository url)
|
||||
"/releases"))
|
||||
(define tag-url
|
||||
(string-append "https://api.github.com/repos/"
|
||||
(string-append (%github-api) "/repos/"
|
||||
(github-user-slash-repository url)
|
||||
"/tags"))
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue