Add link checker and prettier (#49)

Adapted from WP main repo.

Reviewed-on: https://codeberg.org/Codeberg-CI/examples/pulls/49
Co-authored-by: pat-s <patrick.schratz@gmail.com>
Co-committed-by: pat-s <patrick.schratz@gmail.com>
This commit is contained in:
pat-s 2024-04-10 07:16:10 +00:00 committed by Patrick Schratz
parent 531e0933a4
commit 5ffed3d2fa
21 changed files with 92 additions and 38 deletions

8
.prettierrc.json Normal file
View File

@ -0,0 +1,8 @@
{
"semi": true,
"trailingComma": "all",
"singleQuote": true,
"printWidth": 120,
"tabWidth": 2,
"endOfLine": "lf"
}

View File

@ -27,3 +27,15 @@ steps:
image: cytopia/yamllint:alpine-1 image: cytopia/yamllint:alpine-1
commands: commands:
- yamllint --strict -c=.yamllint.yaml . - yamllint --strict -c=.yamllint.yaml .
link-checker:
image: lycheeverse/lychee:0.14.3
depends_on: []
commands:
- lychee .
prettier:
image: docker.io/woodpeckerci/plugin-prettier:0.1.0
depends_on: []
settings:
version: 3.2.5

View File

@ -5,6 +5,7 @@ steps:
# also runs on pull requests targeting these branch. # also runs on pull requests targeting these branch.
when: when:
branch: [master, dev] branch: [master, dev]
event: [push, pull_request]
commands: | commands: |
# alpine uses build-base for dev utilies such as system headers, make etc. # alpine uses build-base for dev utilies such as system headers, make etc.
apk add --no-cache build-base gcc >/dev/null apk add --no-cache build-base gcc >/dev/null

View File

@ -14,6 +14,7 @@ steps:
# also runs on pull requests targeting these branches. # also runs on pull requests targeting these branches.
when: when:
branch: [master, dev] branch: [master, dev]
event: [push, pull_request]
commands: | commands: |
# Possible profiles: # Possible profiles:
# android-arm64-v8a.txt # android-arm64-v8a.txt

View File

@ -16,6 +16,7 @@ steps:
# also runs on pull requests targeting these branches. # also runs on pull requests targeting these branches.
when: when:
branch: [master, dev] branch: [master, dev]
event: [push, pull_request]
commands: | commands: |
mkdir build && cd build mkdir build && cd build
meson .. meson ..

View File

@ -5,6 +5,7 @@
when: when:
branch: main branch: main
event: [push, pull_request]
steps: steps:
publish: publish:
@ -18,7 +19,7 @@ steps:
password: password:
from_secret: docker_token from_secret: docker_token
- registry: https://codeberg.org - registry: https://codeberg.org
username: "6543" username: '6543'
password: password:
from_secret: cb_token from_secret: cb_token
- registry: https://<account-id>.dkr.ecr.<region>.amazonaws.com - registry: https://<account-id>.dkr.ecr.<region>.amazonaws.com

View File

@ -8,6 +8,7 @@
when: when:
branch: main branch: main
event: [push, pull_request]
variables: variables:
- &file Dockerfile.hello - &file Dockerfile.hello

View File

@ -6,6 +6,8 @@
steps: steps:
publish-docker-image: publish-docker-image:
when:
event: [push, pull_request]
image: plugins/kaniko image: plugins/kaniko
settings: settings:
repo: sample/image repo: sample/image

View File

@ -1,6 +1,8 @@
steps: steps:
# Builds your Go application # Builds your Go application
build: build:
when:
event: [push, pull_request]
image: golang image: golang
environment: environment:
# Needed if you want to cross-compile and package the binary in a container. # Needed if you want to cross-compile and package the binary in a container.
@ -15,6 +17,8 @@ steps:
# Runs a dryrun to build the docker container # Runs a dryrun to build the docker container
dryrun-docker: dryrun-docker:
when:
event: [push, pull_request]
image: plugins/kaniko image: plugins/kaniko
settings: settings:
repo: DOCKERUSERNAME/DOCKERHUBREPO repo: DOCKERUSERNAME/DOCKERHUBREPO
@ -22,11 +26,12 @@ steps:
dockerfile: Dockerfile dockerfile: Dockerfile
# Just builds the container without a push to DockerHub. # Just builds the container without a push to DockerHub.
no_push: true no_push: true
when:
event: pull_request
# Builds and publishes a docker container to DockerHub from the main-branch # Builds and publishes a docker container to DockerHub from the main-branch
publish-docker-latest: publish-docker-latest:
when:
branch: main
event: [push]
image: plugins/kaniko image: plugins/kaniko
settings: settings:
repo: DOCKERUSERNAME/DOCKERHUBREPO repo: DOCKERUSERNAME/DOCKERHUBREPO
@ -38,13 +43,14 @@ steps:
password: password:
# Secret 'docker_password' needs to be set in the CI settings # Secret 'docker_password' needs to be set in the CI settings
from_secret: docker_password from_secret: docker_password
when:
# Push new version of tag latest if new push on main-branch
event: push
branch: main
# Builds and publishes a docker container of a tag # Builds and publishes a docker container of a tag
publish-docker-tag: publish-docker-tag:
when:
# Push new version when version tag is created
event: tag
ref: refs/tags/v*
branch: main
image: plugins/kaniko image: plugins/kaniko
settings: settings:
repo: DOCKERUSERNAME/DOCKERHUBREPO repo: DOCKERUSERNAME/DOCKERHUBREPO
@ -57,7 +63,3 @@ steps:
password: password:
# Secret 'docker_password' needs to be set in the CI settings # Secret 'docker_password' needs to be set in the CI settings
from_secret: docker_password from_secret: docker_password
when:
# Push new version when version tag is created
event: tag
ref: refs/tags/v*

View File

@ -1,5 +1,7 @@
steps: steps:
build: build:
when:
event: [push, pull_request]
image: golang image: golang
commands: commands:
- go get - go get

View File

@ -15,6 +15,7 @@
when: when:
branch: branch:
exclude: pages exclude: pages
event: [push, pull_request]
# Recursive cloning is used to fully clone the themes given as Git submodules # Recursive cloning is used to fully clone the themes given as Git submodules
clone: clone:

View File

@ -21,6 +21,8 @@
steps: steps:
build: build:
when:
event: [push, pull_request]
# Use the official jekyll build container # Use the official jekyll build container
image: jekyll/jekyll image: jekyll/jekyll
secrets: [cbtoken, cbmail] secrets: [cbtoken, cbmail]

View File

@ -28,6 +28,8 @@
steps: steps:
# kibot creates the files # kibot creates the files
kibot: kibot:
when:
event: [push, pull_request]
image: ghcr.io/inti-cmnb/kicad7_auto_full:latest image: ghcr.io/inti-cmnb/kicad7_auto_full:latest
commands: commands:
# you just need to run "kibot". If your pcb is in a # you just need to run "kibot". If your pcb is in a
@ -37,6 +39,8 @@ steps:
# gitea package stores the resulting file as a package # gitea package stores the resulting file as a package
artifacts: artifacts:
when:
event: [push, pull_request]
image: gurken2108/drone-gitea-package image: gurken2108/drone-gitea-package
settings: settings:
user: user:

View File

@ -14,49 +14,49 @@ preflight:
# you can use this to raise errors in DRC or ERC # you can use this to raise errors in DRC or ERC
outputs: outputs:
- name: "gerbers" - name: 'gerbers'
comment: "Gerbers for production" comment: 'Gerbers for production'
type: gerber type: gerber
dir: kibot/gerber dir: kibot/gerber
layers: layers:
- "copper" - 'copper'
- "technical" - 'technical'
- name: "gerber-drill" - name: 'gerber-drill'
comment: "Drill positions for production" comment: 'Drill positions for production'
type: "gerb_drill" type: 'gerb_drill'
dir: kibot/gerber dir: kibot/gerber
- name: "gerber-compressed" - name: 'gerber-compressed'
comment: "compressing the gerbers into one convenient file" comment: 'compressing the gerbers into one convenient file'
type: compress type: compress
dir: kibot dir: kibot
options: options:
files: files:
- from_output: "gerbers" - from_output: 'gerbers'
dest: / dest: /
- from_output: "gerber-drill" - from_output: 'gerber-drill'
dest: / dest: /
- name: "ibom" - name: 'ibom'
type: "ibom" type: 'ibom'
comment: "ibom for your convenience" comment: 'ibom for your convenience'
dir: kibot dir: kibot
- name: "schematic-pdf" - name: 'schematic-pdf'
comment: "schematic for your convenience" comment: 'schematic for your convenience'
type: "pdf_sch_print" type: 'pdf_sch_print'
dir: kibot dir: kibot
- name: "production-files" - name: 'production-files'
comment: "compressing all the generated files for easy downloading" comment: 'compressing all the generated files for easy downloading'
type: compress type: compress
dir: kibot dir: kibot
options: options:
files: files:
- from_output: "gerber-compressed" - from_output: 'gerber-compressed'
dest: / dest: /
- from_output: "ibom" - from_output: 'ibom'
dest: / dest: /
- from_output: "schematic-pdf" - from_output: 'schematic-pdf'
dest: / dest: /

View File

@ -23,6 +23,8 @@
steps: steps:
build: build:
when:
event: [push, pull_request]
# Use the official jekyll build container # Use the official jekyll build container
image: node image: node
secrets: [cbtoken, cbmail, cbusername, sourcerepo, destrepo] secrets: [cbtoken, cbmail, cbusername, sourcerepo, destrepo]

View File

@ -4,6 +4,8 @@
steps: steps:
build-docs: build-docs:
when:
event: [push, pull_request]
# build the docs with mkdocs and add the .domains file for codeberg pages # build the docs with mkdocs and add the .domains file for codeberg pages
image: squidfunk/mkdocs-material image: squidfunk/mkdocs-material
commands: commands:
@ -11,6 +13,8 @@ steps:
- echo -e '<yourtld.com>\n<codeberg_username>.codeberg.page\npages.<codeberg_username>.codeberg.page' > site/.domains - echo -e '<yourtld.com>\n<codeberg_username>.codeberg.page\npages.<codeberg_username>.codeberg.page' > site/.domains
deploy-docs: deploy-docs:
when:
event: [push, pull_request]
image: codeberg.org/xfix/plugin-codeberg-pages-deploy:1 image: codeberg.org/xfix/plugin-codeberg-pages-deploy:1
settings: settings:
folder: site folder: site

View File

@ -9,7 +9,9 @@
# Alternatively, the rcmdcheck package can be installed and use in replacement to `R CMD check``. # Alternatively, the rcmdcheck package can be installed and use in replacement to `R CMD check``.
steps: steps:
"Check package": 'Check package':
when:
event: [push, pull_request]
image: rocker/r-base image: rocker/r-base
secrets: [github_pat] secrets: [github_pat]
commands: commands:

View File

@ -10,8 +10,8 @@ Pull requests are welcome!
| [C/.woodpecker/meson-android.yaml](C/.woodpecker/meson-android.yaml) | C/C++ | meson + Android NDK | CI for meson-based projects cross-compiling to Android NDK. | | [C/.woodpecker/meson-android.yaml](C/.woodpecker/meson-android.yaml) | C/C++ | meson + Android NDK | CI for meson-based projects cross-compiling to Android NDK. |
| [Docker/.woodpecker/kaniko.yaml](Docker/.woodpecker/kaniko.yaml) | Dockerfile | [Kaniko][1] | Minimalistic CI pipeline with clear instructions to push a Docker image | | [Docker/.woodpecker/kaniko.yaml](Docker/.woodpecker/kaniko.yaml) | Dockerfile | [Kaniko][1] | Minimalistic CI pipeline with clear instructions to push a Docker image |
| [Docker/.woodpecker/buildx.yaml](Docker/.woodpecker/buildx.yaml) | Dockerfile | [buildx][2] | Build and publish Docker images for multiple architectures on codeberg | | [Docker/.woodpecker/buildx.yaml](Docker/.woodpecker/buildx.yaml) | Dockerfile | [buildx][2] | Build and publish Docker images for multiple architectures on codeberg |
| [golang/.woodpecker/build.yaml](golang/.woodpecker/build.yaml) | golang | golang | Simple ci for building and test a Go project | | [Golang/.woodpecker/build.yaml](Golang/.woodpecker/build.yaml) | golang | golang | Simple ci for building and test a Go project |
| [golang/.woodpecker/build-docker.yaml](golang/.woodpecker/build-docker.yaml) | golang | golang / kaniko | CI to build golang project and build various docker container and publish them on DockerHub | | [Golang/.woodpecker/build-docker.yaml](Golang/.woodpecker/build-docker.yaml) | golang | golang / kaniko | CI to build golang project and build various docker container and publish them on DockerHub |
| [KiCad/.woodpecker.yaml](KiCad/.woodpecker.yaml) | --- | KiBot | Building gerber files, ibom and a pdf schematic as an example for KiBot use | | [KiCad/.woodpecker.yaml](KiCad/.woodpecker.yaml) | --- | KiBot | Building gerber files, ibom and a pdf schematic as an example for KiBot use |
| [NodeJS/.woodpecker.yaml](NodeJS/.woodpecker.yaml) | JavaScript | NodeJS | CI to build static websites files and publish them to Codeberg Pages with 11ty | | [NodeJS/.woodpecker.yaml](NodeJS/.woodpecker.yaml) | JavaScript | NodeJS | CI to build static websites files and publish them to Codeberg Pages with 11ty |
| [Tectonic/.woodpecker.yaml](Tectonic/.woodpecker.yaml) | LaTeX | Tectonic | Builds a TeX file and pushes the resulting PDF file to a given repository. | | [Tectonic/.woodpecker.yaml](Tectonic/.woodpecker.yaml) | LaTeX | Tectonic | Builds a TeX file and pushes the resulting PDF file to a given repository. |

View File

@ -3,6 +3,8 @@ matrix:
steps: steps:
test: test:
when:
event: [push, pull_request]
image: rust image: rust
environment: [CARGO_TERM_COLOR=always] environment: [CARGO_TERM_COLOR=always]
commands: commands:

View File

@ -21,6 +21,8 @@
steps: steps:
build: build:
when:
event: [push, pull_request]
image: dxjoke/tectonic-docker image: dxjoke/tectonic-docker
environment: environment:
- TEX_FOLDER=docs - TEX_FOLDER=docs
@ -28,6 +30,9 @@ steps:
commands: commands:
- tectonic -r 1 $TEX_FOLDER/$TEX_FILENAME.tex - tectonic -r 1 $TEX_FOLDER/$TEX_FILENAME.tex
deploy: deploy:
when:
branch: main
event: [push, pull_request]
image: alpine/git image: alpine/git
environment: environment:
- TEX_FOLDER=docs - TEX_FOLDER=docs
@ -54,5 +59,3 @@ steps:
- git add $PDF_FOLDER/$PDF_FILENAME.pdf - git add $PDF_FOLDER/$PDF_FILENAME.pdf
- git commit -m "Woodpecker CI LaTeX Build at $( env TZ=Europe/Berlin date + "%Y-%m-%d %X %Z" )" - git commit -m "Woodpecker CI LaTeX Build at $( env TZ=Europe/Berlin date + "%Y-%m-%d %X %Z" )"
- git push - git push
when:
branch: main

View File

@ -21,6 +21,8 @@
steps: steps:
build: build:
when:
event: [push, pull_request]
image: 123marvin123/typst image: 123marvin123/typst
environment: environment:
- TYPST_FOLDER=docs - TYPST_FOLDER=docs
@ -56,3 +58,4 @@ steps:
- git push - git push
when: when:
branch: main branch: main
event: [push, pull_request]