Skip to content

Commit 0f62e70

Browse files
Run tests from remote library
1 parent 01c222c commit 0f62e70

4 files changed

Lines changed: 78 additions & 0 deletions

File tree

.github/workflows/test-pr.yml

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
name: Automated test for PRs
2+
3+
# Run any time a PR is created or modified
4+
on:
5+
pull_request:
6+
types: [opened, reopened, synchronize]
7+
8+
env:
9+
# The folder with the doc files
10+
DOCS_FOLDER: 'docs'
11+
# The folder that Docusaurus hosts static files (images) from
12+
STATIC_FOLDER: 'static'
13+
# Images to ignore for image use checks
14+
IGNORE_IMAGES: 'img/site'
15+
# The folder that the tests repo is cloned to
16+
TEST_REPO: 'doclib'
17+
18+
jobs:
19+
20+
# Get files that are added or changed in this PR
21+
# Provides the files as a comma-separated list
22+
getChangedFiles:
23+
runs-on: ubuntu-latest
24+
outputs:
25+
files: ${{ steps.changed-markdown-files.outputs.all_changed_files }}
26+
steps:
27+
# https://github.com/marketplace/actions/changed-files
28+
- name: Get all changed MD/MDX files
29+
id: changed-markdown-files
30+
uses: tj-actions/changed-files@24d32ffd492484c1d75e0c0b894501ddb9d30d62 # v47
31+
with:
32+
separator: ','
33+
files: |
34+
docs/**/*.md
35+
docs/**/*.mdx
36+
37+
# Test the changed files
38+
test:
39+
runs-on: ubuntu-latest
40+
needs: [getChangedFiles]
41+
if: ${{ needs.getChangedFiles.outputs.files != '' }}
42+
steps:
43+
# Clone the repo
44+
- uses: actions/checkout@v2
45+
- uses: actions/setup-node@v1
46+
with:
47+
node-version: 20
48+
# Dependencies may not be necessary
49+
# - run: npm ci
50+
51+
# Clone tests from https://gitlab.com/nomadic-labs/doclib
52+
# Uses https://github.com/marketplace/actions/any-clone-repo
53+
- name: Clone test repo
54+
uses: chihqiang/checkout-action@main
55+
with:
56+
repo: https://gitlab.com/nomadic-labs/doclib.git
57+
branch: main
58+
dest: ${{ env.TEST_REPO }}
59+
- name: Install test repo dependencies
60+
working-directory: ${{ env.TEST_REPO }}
61+
run : npm ci
62+
63+
# Run tests
64+
- name: Run image link check
65+
working-directory: ${{ env.TEST_REPO }}
66+
# Here, --docFiles is the list of changed files so the test checks the links to images in only those files
67+
run: npm run imageLinks -- --baseFolder=${{ github.workspace }} --docFiles=${{ needs.getChangedFiles.outputs.files }} --imageFolder=${{ env.STATIC_FOLDER }}
68+
69+
- name: Run unused image check
70+
working-directory: ${{ env.TEST_REPO }}
71+
# Here, --docFiles is the folder where all of the doc files are so the test can check that no images have become abandoned
72+
run: npm run usedImages -- --baseFolder=${{ github.workspace }} --docFiles=${{ env.DOCS_FOLDER }} --imageFolder=${{ env.STATIC_FOLDER }} --ignoreImages=${{ env.IGNORE_IMAGES }}

docs/get-started/getting-mainnet-tokens.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
title: Getting and exchanging Mainnet tokens
33
---
44

5+
hello
6+
57
The native coin on Etherlink has the symbol XTZ, similar to but separate from the [tez tokens on Tezos layer 1](https://docs.tezos.com/architecture/tokens).
68
For more information about that token and the tokens that are available on Etherlink, see [Tokens](/building-on-etherlink/tokens).
79

docs/get-started/getting-testnet-tokens.mdx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
title: Getting Testnet tokens
33
---
44

5+
hello
6+
57
The native coin on Etherlink has the symbol XTZ, like the [tez tokens on Tezos layer 1](https://docs.tezos.com/architecture/tokens).
68
For more information about that token and the tokens that are available on Etherlink, see [Tokens](/building-on-etherlink/tokens).
79

docs/governance/how-is-etherlink-governed.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
title: How is Etherlink governed?
33
---
44

5+
Hello.
6+
57
Like Tezos, Etherlink has a built-in on-chain mechanism for proposing, selecting, testing, and activating upgrades without the need to hard fork.
68
This mechanism makes Etherlink self-amending and empowers Tezos bakers to govern Etherlink’s kernel upgrades and sequencer operators.
79

0 commit comments

Comments
 (0)