Skip to content

Bump ossf/scorecard-action from 2.4.0 to 2.4.3 #32

Bump ossf/scorecard-action from 2.4.0 to 2.4.3

Bump ossf/scorecard-action from 2.4.0 to 2.4.3 #32

Workflow file for this run

name: CI
on: [push, pull_request]
jobs:
test-macos:
runs-on: macos-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: '1.23'
- name: Build
run: go build ./cmd/lightshell
- name: Test with coverage
run: |
go test ./internal/ipc/ ./internal/security/ ./internal/errors/ ./internal/runtime/ ./internal/compat/ ./tests/ \
-coverprofile=coverage.out -covermode=atomic -count=1
- name: Check coverage threshold
run: |
COVERAGE=$(go tool cover -func=coverage.out | grep total | awk '{print $3}' | sed 's/%//')
echo "Total coverage: ${COVERAGE}%"
if [ "$(echo "$COVERAGE < 85" | bc -l)" -eq 1 ]; then
echo "::error::Coverage ${COVERAGE}% is below the 85% threshold"
go tool cover -func=coverage.out
exit 1
fi
- name: Upload coverage
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
uses: actions/upload-artifact@v4
with:
name: coverage-macos
path: coverage.out
test-linux:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: '1.23'
- name: Install WebKitGTK dependencies
run: sudo apt-get update && sudo apt-get install -y libgtk-3-dev libwebkit2gtk-4.1-dev
- name: Build
run: go build ./cmd/lightshell
- name: Test with coverage
run: |
go test ./internal/ipc/ ./internal/security/ ./internal/errors/ ./internal/runtime/ ./internal/compat/ ./tests/ \
-coverprofile=coverage.out -covermode=atomic -count=1
- name: Check coverage threshold
run: |
COVERAGE=$(go tool cover -func=coverage.out | grep total | awk '{print $3}' | sed 's/%//')
echo "Total coverage: ${COVERAGE}%"
if [ "$(echo "$COVERAGE < 85" | bc -l)" -eq 1 ]; then
echo "::error::Coverage ${COVERAGE}% is below the 85% threshold"
go tool cover -func=coverage.out
exit 1
fi