Skip to content

Commit 3e4b2e4

Browse files
authored
Merge pull request #100 from eseiler/infra/init
[INFRA] Init action
2 parents 5ca4113 + 07c97ce commit 3e4b2e4

File tree

4 files changed

+85
-53
lines changed

4 files changed

+85
-53
lines changed

.github/dependabot.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,9 @@
66

77
version: 2
88
updates:
9-
109
- package-ecosystem: "github-actions"
1110
directory: "/"
1211
schedule:
1312
interval: "weekly"
13+
ignore:
14+
- dependency-name: "PuneetMatharu/cmake-format-lint-action"

.github/workflows/initialise.yml

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
# SPDX-FileCopyrightText: 2006-2025 Knut Reinert & Freie Universität Berlin
2+
# SPDX-FileCopyrightText: 2016-2025 Knut Reinert & MPI für molekulare Genetik
3+
# SPDX-License-Identifier: CC0-1.0
4+
5+
name: Initialise
6+
7+
on:
8+
push:
9+
workflow_dispatch:
10+
11+
env:
12+
TZ: Europe/Berlin
13+
14+
defaults:
15+
run:
16+
shell: bash -Eeuxo pipefail {0}
17+
18+
jobs:
19+
init:
20+
runs-on: ubuntu-latest
21+
if: github.event_name == 'workflow_dispatch' || (github.event.repository.name != 'app-template' && github.event.created)
22+
name: Initialise
23+
permissions:
24+
contents: write
25+
steps:
26+
- name: Checkout
27+
uses: actions/checkout@v4
28+
29+
- name: Initialise
30+
run: |
31+
for file in $(git grep -l '${PROJECT_NAME}'); do sed -i 's/${PROJECT_NAME}/${{ github.event.repository.name }}/g' "${file}"; done
32+
for file in $(git grep -l 'seqan/app-template'); do sed -i 's@seqan/app-template@${{ github.repository }}@g' "${file}"; done
33+
for file in $(git grep -l 'app-template'); do sed -i 's/app-template/${{ github.event.repository.name }}/g' "${file}"; done
34+
35+
sed -i 's/# SeqAn App Template/# ${{ github.event.repository.name }}/' README.md
36+
sed -i 's/App-Template%20CI/${{ github.event.repository.name }}%20CI/g' README.md
37+
sed -i '/<!-- InitDelete -->/,/<!-- DeleteInit -->/d' README.md
38+
39+
git checkout test/data/datasources.cmake
40+
git checkout .github/workflows/*
41+
rm .github/workflows/initialise.yml
42+
rm .github/workflows/ci_cpm.yml
43+
44+
- name: Commit changes
45+
uses: EndBug/add-and-commit@v9
46+
with:
47+
message: 'Initialise repository'

.github/workflows/lint.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ jobs:
1919
name: Lint
2020
runs-on: ubuntu-22.04
2121
timeout-minutes: 30
22+
permissions:
23+
contents: write
2224
steps:
2325
- name: Checkout
2426
uses: actions/checkout@v4

README.md

Lines changed: 34 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -27,16 +27,16 @@ SPDX-License-Identifier: CC0-1.0
2727
`https://img.shields.io/github/workflow/status/` - we do not use GitHub's badges as they are not customisable.
2828
`/seqan/app-template/` - owner/repository
2929
`CI%20on%20Linux` - name of the workflow as encoded URL (e.g., whitespace = %20)
30-
`master` - branch to show
30+
`main` - branch to show
3131
`?style=flat&logo=github` - use a GitHub-style badge
3232
`&label=App-Template%20CI` - text on the badge
3333
`"Open GitHub actions page"` - this text will be shown on hover
3434
-->
3535
[1]: https://img.shields.io/github/actions/workflow/status/seqan/app-template/ci_linux.yml?branch=main&style=flat&logo=github&label=App-Template%20CI "Open GitHub actions page"
3636
<!--
3737
This is the CI badge link:
38-
`https://github.com/seqan/app-template/actions` - actions page of owner(seqan)/repository(app-template)
39-
`?query=branch%3Amaster` - only show actions that ran on the mater branch
38+
`https://github.com/seqan/app-template/actions` - actions page of owner/repository
39+
`?query=branch%3Amain` - only show actions that ran on the mater branch
4040
-->
4141
[2]: https://github.com/seqan/app-template/actions?query=branch%3Amain
4242
<!--
@@ -46,7 +46,7 @@ SPDX-License-Identifier: CC0-1.0
4646
Copy the image part of the markdown badge here.
4747
`"Open Codecov page"` - this text will be shown on hover
4848
-->
49-
[3]: https://codecov.io/gh/seqan/app-template/branch/master/graph/badge.svg?token=V82JRCXF0K "Open Codecov page"
49+
[3]: https://codecov.io/gh/seqan/app-template/branch/main/graph/badge.svg "Open Codecov page"
5050
<!--
5151
This is the Codecov badge link:
5252
Codecov offers badges: https://app.codecov.io/gh/seqan/app-template/settings/badge
@@ -66,69 +66,51 @@ For requirements, check the [Software section of the SeqAn3 Quick Setup](https:/
6666
If you want to build an app, do the following:
6767

6868
0. You need to be signed in with a **GitHub account**.
69-
1. <details><summary>Press the <code>Use this template</code>-Button to create your <b>own repository</b>.</summary><br>
69+
1. Press the `Use this template`-Button to create your own repository. See [GitHub's documentation](https://docs.github.com/en/github/creating-cloning-and-archiving-repositories/creating-a-repository-from-a-template) for more information.
70+
2. **Wait** for GitHub actions to create a commit in your new repository. The commit message will be `Initialise repository` and it will placeholders in the code. Afterwards, the README in your repository will be customised to your repository, among other things.
71+
<!-- InitDelete -->
72+
---
73+
### :warning: Important :warning:
7074

71-
Screenshot TODO
72-
</details>
73-
2. **Clone** your repository locally: `git clone git@github.com:max/my-repo-name.git`
74-
75-
Note: The subsequent steps are not necessary but a recommendation and quick setup.
76-
77-
3. <details><summary>Adapt the project name in <code>my-repo-name/CMakeLists.txt</code>, e.g., from <code>app-template</code> to <code>MyDragonApp</code></summary><br>
78-
79-
The project name is defined in these lines:
80-
81-
```cmake
82-
project (app-template
83-
LANGUAGES CXX
84-
VERSION 1.0.0
85-
DESCRIPTION "My application description"
86-
)
87-
```
75+
From here on out, follow the instructions in your repository.
76+
The instructions below are for the template repository and will not work for your repository.
8877

89-
Change it e.g. to this:
90-
91-
```cmake
92-
project (MyDragonApp
93-
LANGUAGES CXX
94-
VERSION 1.0.0
95-
DESCRIPTION "Let dragons fly"
96-
)
97-
```
98-
</details>
99-
4. <details><summary>Build and test the app (example) </summary><br>
100-
101-
Next to your local repository clone (e.g. `my-repo-name`), you can do the following to build and test your app:
78+
---
79+
<!-- DeleteInit -->
80+
3. **Clone** your repository locally: `git clone git@github.com:seqan/app-template.git`
81+
4. <details><summary>Build and test the app (example) </summary>
82+
In your local repository clone, you can do the following to build and test your app:
10283

10384
```bash
104-
mkdir build # create build directory
105-
cd build # step into build directory
106-
cmake ../my-repo-name # call cmake on the repository
107-
make # build the app MyDragonApp
108-
make check # build and run tests *1
109-
./bin/MyDragonApp # Execute the app (prints a short help page)
85+
mkdir build # create build directory
86+
cd build # step into build directory
87+
cmake .. # call cmake on the repository
88+
make # build the app app-template
89+
make check # build and run tests
90+
./bin/app-template # Execute the app (prints a short help page)
11091
```
11192
</details>
112-
<!-- 8. optional: publish your tool to the galaxy toolshed, follow the example in https://github.com/SGSSGene/raptor-galaxy -->
11393

114-
## Instructions for SeqAn3 Tutorial Purposes:
94+
## Setting up Codecov (optional)
11595

116-
If you just want some hands-on experience with SeqAn Libraries or a quick setup for our tutorials, do the following:
96+
1. Go to https://codecov.io/gh/seqan/app-template.
97+
2. Sign in with your GitHub account.
98+
3. Go to https://app.codecov.io/gh/seqan/app-template/config/general.
99+
4. Copy the `Repository Upload Token`.
100+
5. Go to https://github.com/seqan/app-template/settings/secrets/actions.
101+
6. Add a `New repository secret` with the name `CODECOV_TOKEN` and the value of the `Repository Upload Token`.
102+
7. Done! The next push to your repository will create a Codecov report.
117103

118-
1. Clone this repository: `git clone https://github.com/seqan/app-template.git`
119-
2. Create a build directory and visit it: `mkdir build && cd build`
120-
3. Run CMake: `cmake ../app-template`
121-
4. Build the application: `make`
122-
5. Try executing the app: `./bin/app-template`
104+
## Instructions for SeqAn3 Tutorial Purposes:
123105

124-
You can now start your hands-on experience by looking at or editing the file `src/main.cpp`.
106+
If you just some quick hands-on experience with SeqAn Libraries, you can also just clone this repository and start editing the `src/main.cpp` file.
125107

126108
### Adding a new cpp file
127109

128-
If you want to add a new cpp file (e.g., tutorial1.cpp) that is compiled and linked with the current infrastructure, do the following:
110+
If you want to add a new cpp file (e.g., `tutorial1.cpp`) that is compiled and linked with the current infrastructure, do the following:
129111

130112
1. Create a new file `tutorial1.cpp` in the `src/` directory.
131-
<details><summary>The file content could look like this:</summary><br>
113+
<details><summary>The file content could look like this:</summary
132114

133115
```cpp
134116
#include <seqan3/core/debug_stream.hpp>

0 commit comments

Comments
 (0)