fix(ci): correct path for renders
This commit is contained in:
@@ -8,7 +8,7 @@ A server with a recent version of [docker](https://www.docker.com/) is required.
|
|||||||
|
|
||||||
The command to use is similar to the following:
|
The command to use is similar to the following:
|
||||||
```shell
|
```shell
|
||||||
docker run --env INPUT_TOKEN=**** --env INPUT_USER=user --volume=/tmp:/metrics_renders ghcr.io/lowlighter/metrics:latest
|
docker run --env INPUT_TOKEN=**** --env INPUT_USER=user --volume=/tmp:/renders ghcr.io/lowlighter/metrics:latest
|
||||||
```
|
```
|
||||||
|
|
||||||
To pass parameters, pass environment variable with the same name as the corresponding action option but in uppercase and prefixed with `INPUT_`.
|
To pass parameters, pass environment variable with the same name as the corresponding action option but in uppercase and prefixed with `INPUT_`.
|
||||||
|
|||||||
6
.github/scripts/build.mjs
vendored
6
.github/scripts/build.mjs
vendored
@@ -158,6 +158,7 @@ async function template(id) {
|
|||||||
function testcase(name, env, args) {
|
function testcase(name, env, args) {
|
||||||
const { prod = {}, test = {}, ...step } = JSON.parse(JSON.stringify(args))
|
const { prod = {}, test = {}, ...step } = JSON.parse(JSON.stringify(args))
|
||||||
const context = { prod, test }[env] ?? {}
|
const context = { prod, test }[env] ?? {}
|
||||||
|
const {with:overrides} = context
|
||||||
if (context.skip)
|
if (context.skip)
|
||||||
return null
|
return null
|
||||||
|
|
||||||
@@ -178,8 +179,9 @@ function testcase(name, env, args) {
|
|||||||
if (!(property in result.with))
|
if (!(property in result.with))
|
||||||
result.with[property] = value
|
result.with[property] = value
|
||||||
}
|
}
|
||||||
if ((context.with?.output_action) && (context.with?.committer_branch === "examples"))
|
if ((overrides?.output_action) && (overrides?.committer_branch === "examples")) {
|
||||||
Object.assign(result.with, { output_action: context.with.output_action, committer_branch: "examples" })
|
Object.assign(result.with, { output_action: overrides.output_action, committer_branch: "examples" })
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (env === "test") {
|
if (env === "test") {
|
||||||
|
|||||||
4
.github/scripts/files/examples.yml
vendored
4
.github/scripts/files/examples.yml
vendored
@@ -42,8 +42,8 @@ jobs:
|
|||||||
- name: Screenshot markdown example
|
- name: Screenshot markdown example
|
||||||
if: ${{ success() || failure() }}
|
if: ${{ success() || failure() }}
|
||||||
run: |
|
run: |
|
||||||
node /metrics/.github/scripts/markdown_example.mjs
|
docker run --entrypoint="" --volume=/tmp:/tmp ghcr.io/lowlighter/metrics:master node /metrics/.github/scripts/markdown_example.mjs
|
||||||
mv metrics.markdown.png /
|
sudo mv /tmp/metrics.markdown.png /metrics_renders/
|
||||||
- name: Publish examples
|
- name: Publish examples
|
||||||
if: ${{ success() || failure() }}
|
if: ${{ success() || failure() }}
|
||||||
run: |
|
run: |
|
||||||
|
|||||||
2
.github/scripts/markdown_example.mjs
vendored
2
.github/scripts/markdown_example.mjs
vendored
@@ -17,5 +17,5 @@ const clip = await page.evaluate(() => {
|
|||||||
const { x, y, width, height } = document.querySelector("#readme").getBoundingClientRect()
|
const { x, y, width, height } = document.querySelector("#readme").getBoundingClientRect()
|
||||||
return { x, y, width, height }
|
return { x, y, width, height }
|
||||||
})
|
})
|
||||||
await page.screenshot({ type: "png", path: "metrics.markdown.png", clip, omitBackground: true })
|
await page.screenshot({ type: "png", path: "/tmp/metrics.markdown.png", clip, omitBackground: true })
|
||||||
await browser.close()
|
await browser.close()
|
||||||
|
|||||||
10
.github/workflows/examples.yml
vendored
10
.github/workflows/examples.yml
vendored
@@ -1045,7 +1045,7 @@ jobs:
|
|||||||
markdown: metrics.markdown.template.md
|
markdown: metrics.markdown.template.md
|
||||||
config_output: markdown
|
config_output: markdown
|
||||||
token: ${{ secrets.METRICS_TOKEN }}
|
token: ${{ secrets.METRICS_TOKEN }}
|
||||||
output_action: none
|
output_action: commit
|
||||||
committer_branch: examples
|
committer_branch: examples
|
||||||
delay: 120
|
delay: 120
|
||||||
user: lowlighter
|
user: lowlighter
|
||||||
@@ -1081,7 +1081,7 @@ jobs:
|
|||||||
plugin_isocalendar: yes
|
plugin_isocalendar: yes
|
||||||
plugin_languages: yes
|
plugin_languages: yes
|
||||||
token: ${{ secrets.METRICS_TOKEN }}
|
token: ${{ secrets.METRICS_TOKEN }}
|
||||||
output_action: none
|
output_action: commit
|
||||||
committer_branch: examples
|
committer_branch: examples
|
||||||
delay: 120
|
delay: 120
|
||||||
user: lowlighter
|
user: lowlighter
|
||||||
@@ -1102,7 +1102,7 @@ jobs:
|
|||||||
config_twemoji: yes
|
config_twemoji: yes
|
||||||
config_padding: 5%
|
config_padding: 5%
|
||||||
token: ${{ secrets.METRICS_TOKEN }}
|
token: ${{ secrets.METRICS_TOKEN }}
|
||||||
output_action: none
|
output_action: commit
|
||||||
committer_branch: examples
|
committer_branch: examples
|
||||||
delay: 120
|
delay: 120
|
||||||
user: lowlighter
|
user: lowlighter
|
||||||
@@ -1135,8 +1135,8 @@ jobs:
|
|||||||
- name: Screenshot markdown example
|
- name: Screenshot markdown example
|
||||||
if: ${{ success() || failure() }}
|
if: ${{ success() || failure() }}
|
||||||
run: |
|
run: |
|
||||||
node /metrics/.github/scripts/markdown_example.mjs
|
docker run --entrypoint="" --volume=/tmp:/tmp ghcr.io/lowlighter/metrics:master node /metrics/.github/scripts/markdown_example.mjs
|
||||||
mv metrics.markdown.png /
|
sudo mv /tmp/metrics.markdown.png /metrics_renders/
|
||||||
- name: Publish examples
|
- name: Publish examples
|
||||||
if: ${{ success() || failure() }}
|
if: ${{ success() || failure() }}
|
||||||
run: |
|
run: |
|
||||||
|
|||||||
2
.github/workflows/test.yml
vendored
2
.github/workflows/test.yml
vendored
@@ -45,7 +45,7 @@ jobs:
|
|||||||
- name: Build lowlighter/metrics:${{ github.head_ref || 'master' }}
|
- name: Build lowlighter/metrics:${{ github.head_ref || 'master' }}
|
||||||
run: docker build -t lowlighter/metrics:$(echo ${{ github.head_ref || 'master' }} | sed 's/\//-/g') .
|
run: docker build -t lowlighter/metrics:$(echo ${{ github.head_ref || 'master' }} | sed 's/\//-/g') .
|
||||||
- name: Run tests
|
- name: Run tests
|
||||||
run: docker run --workdir=/metrics --entrypoint="" lowlighter/metrics:$(echo ${{ github.head_ref || 'master' }} | sed 's/\//-/g') npm test -- metrics.test.js
|
run: docker run --entrypoint="" lowlighter/metrics:$(echo ${{ github.head_ref || 'master' }} | sed 's/\//-/g') npm test -- metrics.test.js
|
||||||
|
|
||||||
# Run CodeQL on branch
|
# Run CodeQL on branch
|
||||||
analyze:
|
analyze:
|
||||||
|
|||||||
Reference in New Issue
Block a user