Skip to content

Refactoring Chainloop Labs #3

Refactoring Chainloop Labs

Refactoring Chainloop Labs #3

Workflow file for this run

name: Test and lint
on:
push:
branches:
- main
pull_request:
workflow_call:
permissions:
contents: read
pull-requests: read
jobs:
test_and_lint:
name: Test and lint
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
key:
- test
- lint
steps:
- uses: actions/checkout@v4
with:
submodules: 'recursive'
- name: ${{ matrix.key }}
run: make -C tools ${{ matrix.key }}
test_build:
name: Test if script generation works
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Generate a new script and compare it with the original
run: |
sudo apt -y update
sudo apt -y install build-essential libyaml-dev ruby-dev
sudo gem install bashly
mv tools/c8l tools/c8l.bak
make -C tools build
# compare the generated script with the original and fail if they differ
diff tools/c8l tools/c8l.bak
if [ $? -ne 0 ]; then
echo "Generated script differs from the original"
exit 1
fi