Skip to content

Commit

Permalink
Merge pull request #136 from tortellini-tools/79-worklow-upload-artif…
Browse files Browse the repository at this point in the history
…act-readme

Document example workflows with upload and also test them
  • Loading branch information
sverhoeven authored Jun 14, 2021
2 parents d4bcc28 + be68520 commit 673326f
Show file tree
Hide file tree
Showing 4 changed files with 73 additions and 48 deletions.
21 changes: 21 additions & 0 deletions .github/workflows/usage-current-repository.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: usage on current repository

on: # run any PRs and main branch changes
push:
branches:
- main
- 'releases/*'

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

jobs:
tortellini:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: tortellini-tools/action@main
- uses: actions/upload-artifact@v2
with:
name: tortellini-result
path: .tortellini/out
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
name: usage
name: usage on multiple repositories

on: # run any PRs and main branch changes
pull_request:
push:
branches:
- main
Expand All @@ -11,25 +10,17 @@ on: # run any PRs and main branch changes
workflow_dispatch:

jobs:

tortellini:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- run: |
- name: Create list of GitHub urls to perform check on
run: |
echo 'https://github.com/tortellini-tools/action' > urls.txt
echo 'https://github.com/fair-software/howfairis' >> urls.txt
- uses: tortellini-tools/action@main
with:
repositories: urls.txt
- run: tree -a -I '.git' -L 5 ./

- uses: actions/upload-artifact@v2
with:
name: tortellini-results
path: |
.tortellini
!.tortellini/in
!.tortellini/out/**/analyzer-result.yml
!.tortellini/out/**/evaluation-result.yml
path: .tortellini/out
15 changes: 8 additions & 7 deletions README.dev.md
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ The analyses will be stored in the directories

1. Update the citation metadata in `CITATION.cff`. Afterwards, follow the instructions from the `cffconvert` workfow to sync the information in `.zenodo.json` with that in `CITATION.cff`
1. Actions are run from GitHub repos so we need to generate the Javascript files in the `dist` folder and push the results:

```bash
$ cd $(mktemp --directory --tmpdir tortellini-prep-release.XXXXXX)
$ git clone https://github.com/tortellini-tools/action .
Expand All @@ -137,17 +137,18 @@ The analyses will be stored in the directories
$ git commit --message "prod dependencies"
$ git push origin main
```

1. Next, check if the top three actions on the [action page](https://github.com/tortellini-tools/action/actions?query=branch%3Amain+workflow%3Atortellini+event%3Apush) are green.
1. Create a release on the Github page via
[Create a new release](https://github.com/tortellini-tools/action/releases/new).
1. Create a release on the Github page via
[Create a new release](https://github.com/tortellini-tools/action/releases/new).
1. On the new release page, for `Tag version` use `v` and the next version number, for example `v3`.
See the [versioning documentation](https://github.com/actions/toolkit/blob/master/docs/action-versioning.md)
for more information.
See the [versioning documentation](https://github.com/actions/toolkit/blob/master/docs/action-versioning.md)
for more information.

Your action is now published! :rocket:

Check if the new version has been published on the [Github Marketplace](https://github.com/marketplace/actions/tortellini-action).

You can now validate the action by going to
[this workflow](https://github.com/tortellini-tools/action/actions/workflows/usage.yml)
You can now validate the action by going to
[this workflow](https://github.com/tortellini-tools/action/actions/workflows/usage-current-repository.yml) and [this workflow]([this workflow](https://github.com/tortellini-tools/action/actions/workflows/usage-multiple-repositories.yml))
and then clicking on the button `Run workflow`.
68 changes: 40 additions & 28 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
<p align="center">
<a href="https://github.com/tortellini-tools/action/actions"><img alt="typescript-action status" src="https://github.com/tortellini-tools/action/workflows/build-test/badge.svg"></a>
<a href="https://github.com/tortellini-tools/action/actions"><img alt="linting-action status" src="https://github.com/tortellini-tools/action/workflows/linting/badge.svg"></a>
<a href="https://github.com/tortellini-tools/action/actions"><img alt="tortellini-action status" src="https://github.com/tortellini-tools/action/workflows/tortellini/badge.svg"></a>
<a href="https://github.com/tortellini-tools/action/actions"><img alt="linting-action status" src="https://github.com/tortellini-tools/action/workflows/linting/badge.svg"></a>
<a href="https://github.com/tortellini-tools/action/actions/workflows/usage-current-repository.yml"><img alt="tortellini-action status" src="https://github.com/tortellini-tools/action/actions/workflows/usage-current-repository.yml/badge.svg"></a>
<a href="https://github.com/tortellini-tools/action/actions/workflows/usage-multiple-repositories.yml"><img alt="tortellini-action status" src="https://github.com/tortellini-tools/action/actions/workflows/usage-multiple-repositories.yml/badge.svg"></a>
</p>

# Tortellini GitHub Action

This action checks dependency licence issues using [ort](https://github.com/oss-review-toolkit/ort).
This action checks dependency license issues using [ort](https://github.com/oss-review-toolkit/ort).

<!-- ## Inputs
Expand All @@ -21,44 +22,55 @@ This action checks dependency licence issues using [ort](https://github.com/oss-
See [action.yml](action.yml)

### Own repository

```yaml
on:
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

jobs:
tortellini:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: tortellini-tools/action@main
with:
curations: .tortellini.yml
rules: https://github.com/NLeSC/tortellini-on-rsd/raw/main/config/rules.kts
classifications: https://github.com/NLeSC/tortellini-on-rsd/raw/main/config/license-classifications.yml
tortellini:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: tortellini-tools/action@main
- uses: actions/upload-artifact@v2
with:
name: tortellini-result
path: .tortellini/out
```
Tortellini action will generate `.tortellini/out/scan-report-web-app.html` file.
The HTML file can be downloaded from the workflow page (see the documentation of the [`Upload a Build Artifact` GitHub action](https://github.com/actions/upload-artifact#where-does-the-upload-go)). After unzipping the `scan-report-web-app.html` can be viewed in a web browser.

### Multiple repositories

```yaml
on:
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
jobs:
tortellini:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- run: |
echo 'https://github.com/tortellini-tools/action' > urls.txt
echo 'https://github.com/fair-software/howfairis' >> urls.txt
- uses: tortellini-tools/action@main
with:
repositories: 'urls.txt'
rules: https://github.com/NLeSC/tortellini-on-rsd/raw/main/config/rules.kts
classifications: https://github.com/NLeSC/tortellini-on-rsd/raw/main/config/license-classifications.yml
tortellini:
runs-on: ubuntu-latest
steps:
- name: Create list of GitHub urls to perform check on
run: |
echo 'https://github.com/tortellini-tools/action' > urls.txt
echo 'https://github.com/fair-software/howfairis' >> urls.txt
- uses: tortellini-tools/action@main
with:
repositories: urls.txt
- uses: actions/upload-artifact@v2
with:
name: tortellini-results
path: .tortellini/out
```

Tortellini action will generate `.tortellini/out/index.html` file and `.tortellini/out/<GitHub user or organization>/<GitHub repository>/scan-report-web-app.html` files.

The HTML files can be downloaded from the workflow page (see the documentation of the [`Upload a Build Artifact` GitHub action](https://github.com/actions/upload-artifact#where-does-the-upload-go)). After unzipping the `index.html` can be viewed in a web browser.

## Developer documentation

See [README.dev.md](README.dev.md)
Expand Down

0 comments on commit 673326f

Please sign in to comment.