mirror of
https://github.com/LukeHagar/slinky.git
synced 2025-12-06 04:21:20 +00:00
pushing the rest
This commit is contained in:
70
.github/workflows/ci.yml
vendored
Normal file
70
.github/workflows/ci.yml
vendored
Normal file
@@ -0,0 +1,70 @@
|
||||
name: CI
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
pull_request:
|
||||
branches:
|
||||
- main
|
||||
|
||||
jobs:
|
||||
test:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Setup Go
|
||||
uses: actions/setup-go@v5
|
||||
with:
|
||||
go-version: '1.24.x'
|
||||
|
||||
- name: Cache go build
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: |
|
||||
~/.cache/go-build
|
||||
~/go/pkg/mod
|
||||
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-go-
|
||||
|
||||
- name: Build
|
||||
run: go build ./...
|
||||
|
||||
- name: Run unit tests
|
||||
run: go test ./...
|
||||
|
||||
action-self-test:
|
||||
runs-on: ubuntu-latest
|
||||
needs: test
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Build action image
|
||||
run: |
|
||||
docker build -t slinky-action -f .github/actions/slinky/Dockerfile .
|
||||
|
||||
- name: Run action container (expect nonzero if failures)
|
||||
id: run_action
|
||||
run: |
|
||||
set -e
|
||||
docker run --rm -v "$PWD:/repo" -w /repo -e GITHUB_STEP_SUMMARY="/tmp/summary.md" slinky-action sh -lc \
|
||||
'INPUT_PATH=. INPUT_PATTERNS="test files/**" INPUT_CONCURRENCY=8 INPUT_TIMEOUT=5 INPUT_JSON_OUT=results.json INPUT_MD_OUT=results.md INPUT_FAIL_ON_FAILURES=true INPUT_COMMENT_PR=false INPUT_STEP_SUMMARY=true /entrypoint.sh'
|
||||
|
||||
- name: Upload results.json
|
||||
if: always()
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: results
|
||||
path: results.json
|
||||
- name: Upload results.md
|
||||
if: always()
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: results-md
|
||||
path: results.md
|
||||
|
||||
|
||||
40
.github/workflows/example-slinky.yml
vendored
Normal file
40
.github/workflows/example-slinky.yml
vendored
Normal file
@@ -0,0 +1,40 @@
|
||||
name: Slinky Example
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
branches: [ main ]
|
||||
workflow_dispatch: {}
|
||||
|
||||
jobs:
|
||||
slinky:
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
contents: read
|
||||
pull-requests: write
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Run Slinky link checker
|
||||
uses: ./\.github/actions/slinky
|
||||
with:
|
||||
path: .
|
||||
patterns: "**/*"
|
||||
concurrency: "16"
|
||||
timeout: "10"
|
||||
json-out: results.json
|
||||
md-out: results.md
|
||||
fail-on-failures: "true"
|
||||
comment-pr: "true"
|
||||
step-summary: "true"
|
||||
|
||||
- name: Upload results
|
||||
if: always()
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: slinky-results
|
||||
path: |
|
||||
results.json
|
||||
results.md
|
||||
|
||||
|
||||
Reference in New Issue
Block a user