-
Notifications
You must be signed in to change notification settings - Fork 0
113 lines (91 loc) · 3.33 KB
/
main-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
name: main-ci
on:
pull_request: # default types: opened, synchronize, reopened
branches: [main]
paths:
- 'modules/**'
- '.github/workflows/main-ci.yml'
workflow_dispatch:
env:
SCHEMATIC_VERSION: 24.7.2 # please update .devcontainer as well until this can be set globally somewhere...
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.ref }}
persist-credentials: false # otherwise, the token used is the GITHUB_TOKEN, instead of your personal access token.
fetch-depth: 0 # otherwise, there would be errors pushing refs to the destination repository
- name: Get skip flags
id: check_skip_flags
run: echo "HEAD_COMMIT_MESSAGE=$(git show -s --format=%s)" >> "$GITHUB_OUTPUT"
- name: Setup custom build tools and make jsonld
shell: bash
run: |
bash < <(curl -s https://raw.githubusercontent.com/babashka/babashka/master/install)
git clone --depth 1 https://github.com/anngvu/retold.git
make
# Set up supported python.
- uses: actions/setup-python@v5
with:
python-version: '3.10.12'
- name: Setup schematic and do another convert pass
id: schematic-convert
run: |
pip install schematicpy==${{ env.SCHEMATIC_VERSION }}
pip show schematicpy
schematic schema convert GF.jsonld
- name: Commit files
run: |
git config user.email "[email protected]"
git config user.name "gf-dcc-service"
git commit -m "Build jsonld" -a
- name: Push changes
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: ${{ github.event.pull_request.head.ref }}
# Additionally test PRs
test:
name: Test with schematic
needs: [build]
runs-on: ubuntu-22.04
env:
SCHEMATIC_SERVICE_ACCT_CREDS: ${{ secrets.SCHEMATIC_SERVICE_ACCT_CREDS }}
permissions:
pull-requests: write
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.ref }}
fetch-depth: 1
- uses: actions/setup-python@v5
with:
python-version: '3.10.12'
- name: Setup schematic
id: setup-schematic
run: |
pip install schematicpy==${{ env.SCHEMATIC_VERSION }}
pip show schematicpy
- name: Test generate googlesheets
working-directory: tests/generate
continue-on-error: true
run: ./basic_templates.sh
# TODO Step for test validation of data
# TODO Step for test submission of data
- name: Create test suite report
working-directory: tests
continue-on-error: true
run: docker run -v $(pwd):/tests rocker/tidyverse R -e "rmarkdown::render('tests/test-suite-report.Rmd')"
- name: Report on test suite as PR comment
uses: mshick/add-pr-comment@v2
with:
message-id: test-suite-report
message-path: |
tests/test-suite-report.md
- name: Upload test artifacts
uses: actions/upload-artifact@v3
with:
name: test-logs-${{ matrix.schematic-version }}
path: tests/**/logs