Skip to content

Commit 8146b3d

Browse files
authored
✅ Create ci.yml
1 parent 14cdfa8 commit 8146b3d

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed

.github/workflows/ci.yml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# This is the name of the workflow, it appears in the GitHub Actions tab
2+
name: Continuous Integration
3+
4+
# The name for workflow runs generated from this workflow
5+
run-name: CI Run on ${{ github.ref }} by @${{ github.actor }}
6+
7+
# This specifies the events that will trigger the workflow to run
8+
on: [push, pull_request]
9+
10+
# Jobs define the actual tasks that the workflow will execute
11+
jobs:
12+
setup:
13+
uses: ./.github/workflows/setup_environment.yml
14+
with:
15+
python-version: '3.12'
16+
17+
build_and_check:
18+
needs: setup
19+
runs-on: ubuntu-latest
20+
steps:
21+
- name: Checkout code
22+
uses: actions/checkout@v4
23+
24+
# A step to block .env files
25+
- name: Block .env files from being committed
26+
run: |
27+
if git diff --name-only origin/main..HEAD | grep -qE "^.env|^.env.example|^.env.sample"
28+
then
29+
echo ".env files must not be committed"
30+
exit 1
31+
fi

0 commit comments

Comments
 (0)