Skip to content

Fix CI for copyright header #19

Fix CI for copyright header

Fix CI for copyright header #19

Workflow file for this run

# Copyright 2024 Apple Inc. and the Swift Homomorphic Encryption project authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
name: CI
permissions:
contents: read
on:
workflow_dispatch:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
types: [opened, reopened, synchronize, ready_for_review]
# Pushing changes to PR stops currently-running CI
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
pre-commit:
timeout-minutes: 5
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install pre-commit
run: pip install pre-commit
- name: Pre-commit checks
# CI will commit to `main`, insert-license tested separately
run: >
SKIP=no-commit-to-branch,insert-license
pre-commit run --all-files
insert-license:
timeout-minutes: 1
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 2
- name: Install pre-commit
run: pip install pre-commit
- name: List changed files
run: git diff --name-only HEAD~1
- name: Run license check
run: pre-commit run insert-license --files $(git diff --name-only HEAD~1)