-
Notifications
You must be signed in to change notification settings - Fork 140
65 lines (53 loc) · 1.88 KB
/
validate-compatibility.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
name: Compatibility Validation
# To test with `act` on Apple silicon:
# act -s GITHUB_TOKEN="$(gh auth token)" --container-architecture linux/amd64 -W .github/workflows/validate-compatibility.yml
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
jobs:
validate:
name: Validate that changes are backwards compatible with the last stable release
runs-on: ubuntu-latest
steps:
- name: Checkout repository content
uses: actions/checkout@v4
- name: Clone schema server repository
uses: actions/checkout@v4
with:
repository: ocsf/ocsf-server
path: server
- name: Set up elixir
uses: erlef/setup-beam@v1
with:
elixir-version: 'latest' # Define the elixir version [required]
otp-version: 'latest' # Define the OTP version [required]
# - name: Restore server dependencies cache
# uses: actions/cache@v4
# with:
# path: server/deps
# key: ${{ runner.os }}-mix-${{ hashFiles('**/mix.lock') }}
# restore-keys: ${{ runner.os }}-mix-
- name: Install server dependencies
working-directory: server
run: mix clean --deps & mix deps.get
- name: Build the server
working-directory: server
run: mix compile & mix release --path dist
- name: Run the server
working-directory: server
run: |
SCHEMA_DIR=../
PORT=8080
ENV=prod
dist/bin/schema_server start &
- name: Setup python
uses: actions/setup-python@v4
with:
python-version: '3.11'
- name: Install validator
run: python -m pip install 'ocsf-validate-compatibility>=${{ vars.COMPATIBILITY_VALIDATOR_VERSION || '0.3,<0.4' }}'
- name: Run validator
shell: bash
run: export FORCE_COLOR=1 && python -m ocsf.validate.compatibility ${{ vars.LATEST_STABLE || '1.2.0' }} latest --after-url http://localhost:8080