Repository navigation
78 lines (73 loc) · 2.68 KB
/
Copy pathbuild.yml
File metadata and controls
78 lines (73 loc) · 2.68 KB
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
name: Build
on: [push, pull_request]
jobs:
validate:
runs-on: ubuntu-22.04
steps:
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install \
libxml2-utils \
libxml-libxml-perl \
libxml-libxslt-perl
- name: Clone df-structures
uses: actions/checkout@v4
- name: Validate against schema
run: |
xmllint --schema data-definition.xsd --noout df.*.xml symbols.xml 2>&1 | tee xmllint.out; status=${PIPESTATUS[0]}
echo "** reformatted output: **"
grep -i error xmllint.out | perl -pe 's/(.+):(\d+):/::error file=\1,line=\2::/g'
exit $status
- name: Generate headers
shell: bash
run: |
perl ./codegen.pl | tee codegen.out
if grep -i error codegen.out; then
echo codegen produced error
exit 1
fi
- name: Verify list.pl output
run: |
ls codegen | sort | grep -v codegen.out.xml > ls.out
perl ./list.pl | cut -d/ -f2 | sort > list.pl.out
diff ls.out list.pl.out
dfhack-ref:
runs-on: ubuntu-latest
outputs:
ref: ${{ steps.resolve.outputs.ref }}
steps:
- id: resolve
env:
REPO: ${{ format('{0}/dfhack', github.event_name == 'push' && github.repository_owner || github.event.pull_request.base.repo.owner.login) }}
BRANCH: ${{ github.base_ref || github.ref_name }}
run: |
ref="$BRANCH"
[ "$ref" = master ] && ref=develop
if [ "$ref" != develop ] && ! git ls-remote --exit-code --heads "https://github.com/$REPO" "$ref" >/dev/null 2>&1; then
echo "no '$ref' branch in $REPO; falling back to develop"
ref=develop
fi
echo "ref=$ref" >> "$GITHUB_OUTPUT"
test:
needs: dfhack-ref
uses: DFHack/dfhack/.github/workflows/test.yml@develop
with:
dfhack_repo: ${{ format('{0}/dfhack', github.event_name == 'push' && github.repository_owner || github.event.pull_request.base.repo.owner.login) }}
dfhack_ref: ${{ needs.dfhack-ref.outputs.ref }}
structures_repo: ${{ github.repository }}
structures_ref: ${{ github.ref }}
secrets: inherit
docs:
needs: dfhack-ref
uses: DFHack/dfhack/.github/workflows/build-linux.yml@develop
with:
dfhack_repo: ${{ format('{0}/dfhack', github.event_name == 'push' && github.repository_owner || github.event.pull_request.base.repo.owner.login) }}
dfhack_ref: ${{ needs.dfhack-ref.outputs.ref }}
structures_repo: ${{ github.repository }}
structures_ref: ${{ github.ref }}
artifact-name: docs
platform-files: false
common-files: false
docs: true
secrets: inherit