Add github-actions
updates label with skip-notes
#390
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Test render | |
on: | |
pull_request: | |
branches: [main] | |
permissions: | |
contents: read | |
env: | |
# Generate diffs relative to our downstream PR branch, not to downstream Git | |
# main. This omits changes that have merged in repo-templates but haven't | |
# merged downstream yet, making review easier. The Makefile does the same | |
# when generating diffs for interactive development. | |
FORK_ARGS: --fork-regex /coreos/ --fork-replacement /coreosbot-releng/ --fork-branch repo-templates | |
jobs: | |
render: | |
name: Render | |
runs-on: ubuntu-latest | |
container: registry.fedoraproject.org/fedora:latest | |
steps: | |
- name: Check out repository | |
uses: actions/checkout@v3 | |
- name: Install dependencies | |
run: dnf install -y cargo git-core python3-pyyaml | |
- name: Check for unreferenced templates | |
run: | | |
python3 -c 'import yaml; print("\n".join(yaml.safe_load(open("config.yaml"))["templates"]))' | | |
sed -e 's/\.[a-z0-9]*$/.yaml/' -e '/^[^.]*$/ s/$/.yaml/' > expected | |
stray=$(find . -path ./config.yaml -prune -o -name '*.yaml' -print | | |
sed 's:^\./::' | | |
grep -Fvxf expected ||:) | |
if [ -n "${stray}" ]; then | |
echo "Found template configs not referenced in config.yaml:" | |
echo "${stray}" | |
exit 1 | |
fi | |
- name: Cache build artifacts | |
uses: Swatinem/rust-cache@v2 | |
with: | |
workspaces: tmpl8 | |
- name: Build tmpl8 binary | |
run: cd tmpl8 && cargo build | |
- name: Sync cache | |
run: tmpl8/target/debug/tmpl8 update-cache $FORK_ARGS | |
- name: Render diffs | |
run: tmpl8/target/debug/tmpl8 diff $FORK_ARGS |