Skip to content

Merge remote-tracking branch 'origin/main' #220

Merge remote-tracking branch 'origin/main'

Merge remote-tracking branch 'origin/main' #220

Workflow file for this run

name: testing
on:
pull_request:
push:
branches:
- main
workflow_dispatch:
jobs:
live-sandbox-cli:
runs-on: ubuntu-latest
steps:
- name: get a copy of the repo contents
uses: actions/checkout@v4
- name: install the project's dependencies
run: npm install
- name: generate a distributable tarball
run: npm run all
- name: install the cli from the tarball
run: sudo npm install -g zenodraft-*.tgz
- name: create a new directory to do the testing in
run: mkdir testing && cd testing
- name: Test zenodraft CLI
env:
ZENODO_SANDBOX_ACCESS_TOKEN: ${{ secrets.ZENODO_SANDBOX_ACCESS_TOKEN }}
VERSION_ID: ""
shell: bash
run: |
set -e
echo "test creating a new draft deposition in a new concept on zenodo sandbox"
VERSION_ID=$(zenodraft deposition create concept --sandbox)
echo "test showing the complete details for the draft deposition"
zenodraft deposition show details --sandbox $VERSION_ID
echo "test showing the prereserved doi for the draft deposition"
zenodraft deposition show prereserved --sandbox $VERSION_ID
echo "test adding a file to the draft deposition"
echo "these are the file contents" > thefile.txt
zenodraft file add --sandbox $VERSION_ID thefile.txt
echo "test removing a file from the draft deposition"
zenodraft file delete --sandbox $VERSION_ID thefile.txt
echo "test updating the deposition metadata with information from a local file"
echo "{\"creators\":[{\"affiliation\":\"Netherlands eScience Center\",\"name\":\"Spaaks, Jurriaan H.\",\"orcid\":\"0000-0002-7064-4069\"}],\"description\":\"Auto-generated draft deposition for CI testing of zenodraft's CLI\",\"keywords\":[\"zenodo\",\"cli\"],\"license\":{\"id\":\"Apache-2.0\"},\"title\":\"Auto-generated deposition for testing purposes\"}" > .zenodo.json
zenodraft metadata update --sandbox $VERSION_ID .zenodo.json
echo "test clearing the deposition metadata"
zenodraft metadata clear --sandbox $VERSION_ID
echo "test deleting a draft deposition"
zenodraft deposition delete --sandbox $VERSION_ID
unit:
runs-on: ubuntu-latest
steps:
- name: get a copy of the repo contents
uses: actions/checkout@v2
- name: install the dependencies
run: npm install
- name: run the unit tests using jest and calculate coverage
run: npm run test