Repository navigation
107 lines (88 loc) · 3.03 KB
/
Copy pathtest.yml
File metadata and controls
107 lines (88 loc) · 3.03 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
---
name: Test
# run on pull requests and all (feature/fix) branches
on:
pull_request:
push:
branches:
- '**'
- '!main'
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
# https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#concurrency
concurrency:
group: ${{ github.head_ref || github.run_id }}
cancel-in-progress: true
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: checkout documentation.eccenca.com
uses: actions/checkout@v4
with:
submodules: "recursive"
fetch-depth: "0"
- name: setup python
uses: actions/setup-python@v5
with:
python-version: 3.11
- name: install task
uses: arduino/setup-task@v2
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
- name: install and configure poetry
uses: snok/install-poetry@v1
with:
virtualenvs-create: true
virtualenvs-in-project: true
installer-parallel: true
- name: load environment cache
id: cached-poetry-dependencies
uses: actions/cache@v4
with:
path: .venv
key: venv-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('**/poetry.lock') }}
- name: update packages
run: sudo apt-get update -y
- name: install packages
run: sudo apt-get install -y libffi-dev libz-dev
- name: test
run: task test:unit
- name: install lychee
env:
LYCHEE_VERSION: "0.24.2"
LYCHEE_ASSET: lychee-x86_64-unknown-linux-gnu
LYCHEE_RELEASES: https://github.com/lycheeverse/lychee/releases/download
run: |
curl -sSfL "${LYCHEE_RELEASES}/lychee-v${LYCHEE_VERSION}/${LYCHEE_ASSET}.tar.gz" \
| sudo tar -xz -C /usr/local/bin --strip-components=1 "${LYCHEE_ASSET}/lychee"
lychee --version
- name: load link check cache
uses: actions/cache@v4
with:
path: .lycheecache
# A new key per run saves the updated cache; restore-keys picks up the latest one.
# lychee itself re-checks entries older than max_cache_age (lychee.toml).
key: lychee-${{ github.run_id }}
restore-keys: lychee-
- name: check
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: task check
- name: Publish Test Results
if: always()
uses: EnricoMi/publish-unit-test-result-action@v2
with:
check_name: "Markdown lint"
files: "dist/md-lint-issues.xml"
# MD061/MD044 (wording, proper names): reported, but the check run stays green
- name: Publish cosmetic lint results
if: always()
uses: EnricoMi/publish-unit-test-result-action@v2
with:
check_name: "Markdown lint (cosmetic)"
files: "dist/md-lint-cosmetic-issues.xml"
fail_on: "nothing"
comment_mode: "off"
- name: build
run: task clean build