This repository has been archived by the owner on Jan 31, 2023. It is now read-only.
forked from electricitymaps/electricitymaps-contrib
-
Notifications
You must be signed in to change notification settings - Fork 0
118 lines (108 loc) · 3.58 KB
/
CI.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
name: CI
on:
push:
pull_request:
jobs:
# This job is used to determine what files have changed and is used by later jobs to determine if they should run.
setup:
name: Setup
runs-on: ubuntu-latest
timeout-minutes: 1
outputs:
frontend: ${{ steps.check-frontend.outputs.any_changed }}
markdown: ${{ steps.check-markdown.outputs.any_changed }}
json: ${{ steps.check-json.outputs.any_changed }}
python: ${{ steps.check-python.outputs.any_changed }}
workflows: ${{ steps.check-workflows.outputs.any_changed }}
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 2
- name: Check frontend files
id: check-frontend
uses: tj-actions/[email protected]
with:
files: |
**/web/**/*
files_ignore: |
**/web/public/locales/*.json
**/web/**/*.md
- name: Check markdown files
id: check-markdown
uses: tj-actions/[email protected]
with:
files: |
**/*.md
- name: Check json files
id: check-json
uses: tj-actions/[email protected]
with:
files: |
**/*.json
- name: Check python files
id: check-python
uses: tj-actions/[email protected]
with:
files: |
**/*.py
pyproject.toml
poetry.lock
.python-version
- name: Check if workflows have changed
id: check-workflows
uses: tj-actions/[email protected]
with:
files: |
**/.github/workflows/**/*.yml
- name: Log outputs
run: |
echo "frontend changed: ${{ steps.check-frontend.outputs.any_changed }}"
echo "markdown changed: ${{ steps.check-markdown.outputs.any_changed }}"
echo "json changed: ${{ steps.check-json.outputs.any_changed }}"
echo "python changed: ${{ steps.check-python.outputs.any_changed }}"
echo "workflows changed: ${{ steps.check-workflows.outputs.any_changed }}"
# Repository wide checks
# prettier:
# name: Prettier
# uses: ./.github/workflows/prettier.yml
validate_local_links:
name: Validate Markdown
needs: [setup, prettier]
if: needs.setup.outputs.markdown != 'false' || needs.setup.outputs.workflows != 'false'
uses: ./.github/workflows/validate-local-links-in-md.yml
# jest:
# name: Jest
# needs: [setup]
# if: needs.setup.outputs.frontend != 'false' || needs.setup.outputs.workflows != 'false'
# uses: ./.github/workflows/jest.yml
jsonlint:
name: JSONLint
needs: [setup, prettier]
if: needs.setup.outputs.json != 'false' || needs.setup.outputs.workflows != 'false'
uses: ./.github/workflows/jsonlint.yml
# Frontend checks
eslint:
name: ESLint
needs: [setup, prettier]
if: needs.setup.outputs.frontend != 'false' || needs.setup.outputs.workflows != 'false'
uses: ./.github/workflows/eslint.yml
# verify:
# name: Verify
# needs: [setup, prettier]
# if: needs.setup.outputs.frontend != 'false' || needs.setup.outputs.workflows != 'false'
# uses: ./.github/workflows/verify.yml
# cypress:
# name: Cypress
# needs: [eslint, verify]
# uses: ./.github/workflows/cypress.yml
# secrets: inherit
# Python checks
# python:
# name: Python
# needs: [setup]
# if: needs.setup.outputs.python != 'false' || needs.setup.outputs.workflows != 'false'
# uses: ./.github/workflows/python.yml
# codeql:
# name: CodeQL
# uses: ./.github/workflows/codeql.yml