Skip to content

repo_tests

repo_tests #41

Workflow file for this run

name: repo_tests
on: [workflow_dispatch, workflow_call]
jobs:
repo_tests:
name: ${{ matrix.repo }} ${{ matrix.description }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
# Items in this list satisfy a few criteria:
#
# * test has to be useful/interesting and add value atop the monorepo tests for
# trunk init
#
# * the repo has to exercise some functionality specific to action.yaml (e.g. our
# custom Node functionality for npm/yarn/pnpm)
#
# * the repo and its dependency closure should be fast to set up, since we trigger
# this workflow on PRs
#
- repo: highlightjs/highlight.js
ref: 4f9cd3bffb6bc55c9e2c4252c7b733a219880151
description: (uses npm)
post-init: |
cp local-action/repo_tests/highlightjs.yaml .trunk/user.yaml
- repo: jbeder/yaml-cpp
ref: 0e6e28d1a38224fc8172fae0109ea7f673c096db
description: (compile-commands.json)
post-init: |
# black complains about py2 code
${TRUNK_PATH} check disable black
mkdir build
cd build
cmake .. -DCMAKE_EXPORT_COMPILE_COMMANDS=ON
cd ..
ln -s build/compile_commands.json
sed -i "s|lint:|lint:\n compile_commands: json|" .trunk/trunk.yaml
cp local-action/repo_tests/yaml_cpp.yaml .trunk/user.yaml
${TRUNK_PATH} check enable clang-tidy
# fails because of a malformed html file
# - repo: pallets/flask
# ref: 2b2a7641430bc7d40dba3c8d701636fc9b16530c
# post-init: |
# cp local-action/repo_tests/flask.yaml .trunk/user.yaml
- repo: postcss/postcss
ref: aa9e03ea4708909631eba70500c8c0cc0708bb4e
description: (uses pnpm)
post-init: |
${TRUNK_PATH} check enable eslint
- repo: replayio/devtools
ref: 730a9f0ddaafefc2a1a293d6924ce3910cd156ac
description: (has trunk.yaml)
post-init: |
# replay is on a very old version
${TRUNK_PATH} upgrade
trunk-path: node_modules/.bin/trunk
- repo: sass/sass
ref: 225e176115211387e014d97ae0076d94de3152a1
description: (uses npm)
# fails because yarn install would update the yarn lockfile
# - repo: sheldonhull/sheldonhull.hugo
# ref: 4796211f1adeeb1858f2f9bf74d7ee0b4e2d8988
# description: (has trunk.yaml)
- repo: shopify/draggable
ref: e6cf325a98c11b8aefbfb626b7a91b95d1c340c9
description: (uses yarn)
- repo: terraform-linters/tflint
ref: 9c34a740319e2410094ca2754e5eca860f2d13f5
post-init: |
# golangci-lint needs us to init with a newer go runtime
${TRUNK_PATH} check disable golangci-lint
- repo: trunk-io/plugins
ref: main
# fails because pnpm version is too new
# - repo: vuejs/core
# ref: 2d9f6f926453c46f542789927bcd30d15da9c24b
# description: (uses pnpm)
# post-init: |
# # svgo gets confused by JS module loading
# ${TRUNK_PATH} check disable svgo
- repo: z-shell/wiki
ref: 7d0ea1b14d2f163d54111655aa9aa737f3710b72
description: (has trunk.yaml)
steps:
- name: Checkout ${{ matrix.repo }}
uses: actions/checkout@v3
with:
repository: ${{ matrix.repo }}
ref: ${{ matrix.ref }}
- name: Checkout ${{ github.repository }}
uses: actions/checkout@v3
with:
path: local-action
- name: Run trunk-action in ${{ matrix.repo }}
id: trunk
uses: ./local-action/
with:
cache: true
check-mode: all
trunk-path: ${{ matrix.trunk-path }}
post-init: ${{ matrix.post-init }}
arguments: --output-file=.trunk/landing-state.json
cache-key: repo_tests/${{ matrix.repo }}
setup-deps: true
continue-on-error: true
- name: Check for task failures
shell: bash
run: |
python3 local-action/repo_tests/check_for_task_failures.py \
'${{ github.env }}' \
'${{ matrix.repo }}' \
'${{ matrix.description }}'
- name: Upload landing state
uses: actions/upload-artifact@v3
with:
name: ${{ env.landing_state_artifact_name }} landing state
path: .trunk/landing-state.json