Skip to content

feat: add nogo as a simple linting option #956

feat: add nogo as a simple linting option

feat: add nogo as a simple linting option #956

Workflow file for this run

on:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
test:
strategy:
matrix:
scaffold-version:
- v0.3.0
preset:
- cpp
- go
- java
- js
- kitchen-sink
- minimal
- py
- rust
- shell
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: bazel-contrib/[email protected]
with:
bazelisk-cache: true
repository-cache: true
- uses: jaxxstorm/action-install-gh-release@cd6b2b78ad38bdd294341cda064ec0692b06215b # v1.14.0
with:
repo: hay-kot/scaffold
tag: ${{ matrix.scaffold-version }}
- name: setting to always run hooks
if: "${{ matrix.preset != 'minimal' }}"
run: echo "SCAFFOLD_SETTINGS_RUN_HOOKS=always" >> "$GITHUB_ENV"
- name: Scaffold new app
id: scaffold
run: |
scaffold new --preset=${{ matrix.preset }} --no-prompt $GITHUB_WORKSPACE
cd scaffold_test*
git init
git add .
git config user.email "[email protected]"
git config user.name "No One"
git commit -a -m "initial commit"
echo "dir=$PWD" >> $GITHUB_OUTPUT
- run: bazel test ...
working-directory: "${{ steps.scaffold.outputs.dir }}"
- run: bazel run format
working-directory: "${{ steps.scaffold.outputs.dir }}"
if: "${{ matrix.preset != 'minimal' }}"
- name: format made no changes
working-directory: "${{ steps.scaffold.outputs.dir }}"
run: git diff --exit-code
- name: User Stories
working-directory: "${{ steps.scaffold.outputs.dir }}"
run: $GITHUB_WORKSPACE/user_stories/${{ matrix.preset}}
- name: Python test that fails
continue-on-error: true # for some reason `bazel test || true` still failing.
run: bazel test //app:app_test
working-directory: "${{ steps.scaffold.outputs.dir }}"
if: "${{ matrix.preset == 'py' }}"
- name: Check failure is expected
working-directory: "${{ steps.scaffold.outputs.dir }}"
if: "${{ matrix.preset == 'py' }}"
run: grep "FAILED app/app_test.py::test_bad - assert 1 == 2" $(bazel info bazel-testlogs)/app/app_test/test.log
- run: bazel lint ...
working-directory: "${{ steps.scaffold.outputs.dir }}"
# For branch protection settings, this job provides a "stable" name that can be used to gate PR merges
# on "all matrix jobs were successful".
conclusion:
needs: test
runs-on: ubuntu-latest
if: always()
steps:
- uses: technote-space/workflow-conclusion-action@45ce8e0eb155657ab8ccf346ade734257fd196a5 # v3.0.3
# Note: possible conclusion values:
# https://github.com/technote-space/workflow-conclusion-action/blob/main/src/constant.ts
- name: report success
if: ${{ env.WORKFLOW_CONCLUSION == 'success' }}
working-directory: /tmp
run: echo ${{ env.WORKFLOW_CONCLUSION }} && exit 0
- name: report failure
if: ${{ env.WORKFLOW_CONCLUSION == 'failure' }}
working-directory: /tmp
run: echo ${{ env.WORKFLOW_CONCLUSION }} && exit 1