Skip to content

Commit

Permalink
Some more fragments and an exercise
Browse files Browse the repository at this point in the history
  • Loading branch information
jorgensd committed Nov 22, 2023
1 parent 32946ae commit 5b71a56
Showing 1 changed file with 39 additions and 8 deletions.
47 changes: 39 additions & 8 deletions docs/ci.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ To ensure quality, consistency and reproducibility of your research, -->
<div>
<ul>
<li>Many ways to do CI; use the one you prefer</li>
<div style="display:contents;" data-marpit-fragment>
<ul>
<li>Github Actions</li>
<li>Azure DevOps</li>
Expand All @@ -43,6 +44,8 @@ To ensure quality, consistency and reproducibility of your research, -->
</ul>
<li>List of
<a href="https://github.com/ligurio/awesome-ci"> CI services</a>
</div>

</ul>

* We will use Github Actions
Expand Down Expand Up @@ -91,8 +94,14 @@ on:
pull_request:
branches: main
```
* Workflow is triggered whenever a pull request is made against the main branch
* Can make a list of branches, or include all (`"*"`, or no branch `"!*"` or patterns `"v*"`)
<div style="display:contents;" data-marpit-fragment>
**Triggered when**
* A pull request is made against the `main` branch
* Can make a list of branches `[development, main, "v[0-9].[0-9]+.[0-9]+"]`
* [Cheatsheet](https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#filter-pattern-cheat-sheet) for patterns
</div>

---
### Run on push
Expand All @@ -105,10 +114,13 @@ on:
- "v*"
```
#### Triggered whenever

<div style="display:contents;" data-marpit-fragment>

**Triggered when**
* A push a commited to any branch
* A tag starting with `v` is created

</div>

---

Expand All @@ -119,8 +131,13 @@ on:
schedule:
- cron: 0 9 * * 1
```
* Triggered at a specific UCT time in POSIX cron syntax
* Easy interpreter at: [Crontab.guru](https://crontab.guru/#0_9_*_*_1)

<div style="display:contents;" data-marpit-fragment>

**Triggered when**
- Specific UCT time in POSIX cron syntax
- Easy interpreter at: [Crontab.guru](https://crontab.guru/#0_9_*_*_1)
</div>

---

Expand Down Expand Up @@ -158,8 +175,11 @@ Source: [https://github.com/jorgensd/dolfinx_mpc/actions/runs/6932364745](https:
on:
workflow_dispatch:
```
- Run a workflow manually on CI

<div style="display:contents;" data-marpit-fragment>
Run a workflow manually on CI
<img src="./workflow_dispatch.png" alt="Manual workflow call" class="bg-primary" width="1000px">
</div>

---

Expand Down Expand Up @@ -195,7 +215,6 @@ jobs:
- Windows (2019, 2022)
- Mac (macos-11, macos-12)
---
## Complex dependencies? Use containers!
Expand Down Expand Up @@ -233,6 +252,18 @@ jobs:

---

## Exercise

- Make a branch in your repository
- Create a workflow that runs on Ubuntu 22.04
- Workflow should run:
- On every commit on main
- On every pull request to any branch
- List the files in the repository

---


### Actions can take inputs

```yaml
Expand Down

0 comments on commit 5b71a56

Please sign in to comment.