Skip to content

Update README.dev.md #283

Update README.dev.md

Update README.dev.md #283

Workflow file for this run

name: testing
on:
pull_request:
push:
branches:
- main
workflow_dispatch:
jobs:
live-sandbox-cli:
env:
ZENODO_SANDBOX_ACCESS_TOKEN: ${{ secrets.ZENODO_SANDBOX_ACCESS_TOKEN }}
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 creating a new draft deposition in a new concept on Zenodo Sandbox
run: |
VERSION_ID=$(zenodraft deposition create concept --sandbox)
echo "VERSION_ID=$VERSION_ID" >> "$GITHUB_ENV"
- name: Test showing the complete details for the draft deposition
run: |
zenodraft deposition show details --sandbox $VERSION_ID
- name: Test showing the prereserved doi for the draft deposition
run: |
zenodraft deposition show prereserved --sandbox $VERSION_ID
- name: Test adding a file to the draft deposition
run: |
echo "these are the file contents" > thefile.txt
zenodraft file add --sandbox $VERSION_ID thefile.txt
- name: Test removing a file from the draft deposition
run: |
zenodraft file delete --sandbox $VERSION_ID thefile.txt
- name: Test updating the deposition metadata with information from a local file
run: |
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
- name: Test clearing the deposition metadata
run: |
zenodraft metadata clear --sandbox $VERSION_ID
- name: Test deleting a draft deposition
run: |
zenodraft deposition delete --sandbox $VERSION_ID
unit:
runs-on: ubuntu-latest
steps:
- name: get a copy of the repo contents
uses: actions/checkout@v4
- name: install the dependencies
run: npm install
- name: run the unit tests using jest and calculate coverage
run: npm run coverage