-
Notifications
You must be signed in to change notification settings - Fork 3
135 lines (122 loc) · 3.92 KB
/
clingo.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
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
name: clingo
on:
push:
branches:
- main
tags:
- v0.**
pull_request:
branches:
- main
workflow_dispatch:
concurrency:
group: clingo-${{ github.ref }}
cancel-in-progress: true
env:
SPACK_COLOR: always
SPACK_BACKTRACE: please
jobs:
macos_clingo:
runs-on: ${{ matrix.os }}
strategy:
matrix:
python-version: ["3.6", "3.7", "3.8", "3.9", "3.10", "3.11", "3.12"]
os: ["macos-12", "macos-14"]
exclude:
- python-version: "3.6"
os: "macos-14"
- python-version: "3.7"
os: "macos-14"
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v4
with:
repository: spack/spack
ref: 540f9eefb70b86c8403868d28f88a68cec585ce3
path: spack
- uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: system dependencies
run: brew install bison
- name: configure
run: |
echo $(brew --prefix bison)
export PATH="$(brew --prefix bison)/bin:$PATH"
. spack/share/spack/setup-env.sh
spack external find --not-buildable cmake bison
spack python -c "import archspec.cpu;print(archspec.cpu.host().family)" > target.txt
spack config add config:install_tree:padded_length:256
spack config add "packages:all:require:[target=$(cat target.txt)]"
spack config blame
- name: install
run: |
. spack/share/spack/setup-env.sh
spack python clingo/scripts/install_clingo.py
spack buildcache push --unsigned ./binary-mirror clingo-bootstrap
- uses: actions/upload-artifact@v3
with:
name: clingo_binary_mirror
path: binary-mirror
manylinux2014:
runs-on: ["self-hosted", "Linux"]
outputs:
spack_manylinux_tag: ${{ fromJSON(steps.docker_meta.outputs.json).tags[0] }}
permissions:
packages: write
steps:
- uses: actions/checkout@v4
# Setup tags to be used for docker images
- uses: docker/metadata-action@v5
id: docker_meta
with:
images: ghcr.io/${{ github.repository_owner }}/clingo_manylinux2014
# Login to Github Packages
- uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- uses: docker/setup-qemu-action@v3
id: qemu
with:
platforms: linux/ppc64le,linux/arm64
- uses: docker/setup-buildx-action@v3
# Build and eventually push to registry
- uses: docker/build-push-action@v5
with:
file: ./clingo/Dockerfile.manylinux2014
platforms: linux/arm64,linux/ppc64le,linux/amd64
cache-from: |
ghcr.io/${{ github.repository_owner }}/clingo_manylinux2014:main
${{ steps.docker_meta.outputs.tags }}
cache-to: type=inline
pull: ${{ github.event_name == 'pull_request' }}
push: true
tags: ${{ steps.docker_meta.outputs.tags }}
labels: ${{ steps.docker_meta.outputs.labels }}
upload-manylinux2014:
runs-on: ubuntu-latest
needs: [ manylinux2014 ]
env:
SPACK_MANYLINUX2014_TAG: ${{ needs.manylinux2014.outputs.spack_manylinux_tag }}
steps:
- uses: actions/checkout@v4
- run: ./contrib/copy_mirror_manylinux2014.sh
- uses: actions/upload-artifact@v3
with:
name: clingo_binary_mirror
path: binary-mirror
clingo_json:
runs-on: ubuntu-latest
needs: [ upload-manylinux2014, macos_clingo ]
steps:
- uses: actions/checkout@v4
- uses: actions/download-artifact@v3
with:
name: clingo_binary_mirror
- run: python3 clingo/scripts/clingo_json.py
- uses: actions/upload-artifact@v3
with:
name: clingo_manifest
path: clingo.json