Skip to content

Commit 21a8397

Browse files
committed
Fix ubuntu CI
1 parent 17b0887 commit 21a8397

File tree

2 files changed

+31
-18
lines changed

2 files changed

+31
-18
lines changed

.github/workflows/ubuntu.yml

Lines changed: 31 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,17 @@ jobs:
4444

4545
- name: Get SOFA nightly build link
4646
id: sofa_nightly_link
47-
run: echo "::set-output name=link::$(curl -s 'https://api.github.com/repos/jnbrunet/sofa/actions/artifacts' | python3 -c "import sys,json,re;print(sorted(filter(lambda a:re.search('${{ matrix.os }}', a['name'], re.I),json.load(sys.stdin)['artifacts']), reverse=False, key=lambda a:a['created_at'])[-1]['archive_download_url'])")"
48-
shell: bash
47+
shell: python
48+
run: |
49+
import urllib.request, json, sys, re
50+
url = 'https://api.github.com/repos/jnbrunet/sofa/actions/artifacts'
51+
req = urllib.request.Request(url)
52+
req.add_header('authorization', 'Bearer ${{ secrets.GITHUB_TOKEN }}')
53+
r = urllib.request.urlopen(req).read()
54+
artifacts = json.loads(r.decode('utf-8'))['artifacts']
55+
os_artifacts = filter(lambda a:re.search('${{ matrix.os }}', a['name'], re.I), artifacts)
56+
last_artifact_url = sorted(os_artifacts, reverse=False, key=lambda a:a['created_at'])[-1]['archive_download_url']
57+
print(f"::set-output name=link::{last_artifact_url}")
4958
5059
- name: Cache SOFA
5160
uses: actions/cache@v2
@@ -56,8 +65,10 @@ jobs:
5665

5766
- name: Download SOFA nightly build
5867
if: steps.sofa_cache.outputs.cache-hit != 'true'
59-
run: curl --output sofa.zip
60-
-u jnbrunet:$TOKEN -L -o sofa.zip /
68+
run: |
69+
curl --output sofa.zip \
70+
--header 'authorization: Bearer ${{ secrets.GITHUB_TOKEN }}' \
71+
-u jnbrunet:$TOKEN -L -o sofa.zip / \
6172
${{ steps.sofa_nightly_link.outputs.link }}
6273
6374
- name: Install SOFA nightly build
@@ -125,10 +136,20 @@ jobs:
125136
- name: Install requirements
126137
run: |
127138
python3 -m pip install numpy
139+
128140
- name: Get SOFA nightly build link
129141
id: sofa_nightly_link
130-
run: echo "::set-output name=link::$(curl -s 'https://api.github.com/repos/jnbrunet/sofa/actions/artifacts' | python3 -c "import sys,json,re;print(sorted(filter(lambda a:re.search('ubuntu-18\.04', a['name'], re.I),json.load(sys.stdin)['artifacts']), reverse=False, key=lambda a:a['created_at'])[-1]['archive_download_url'])")"
131-
shell: bash
142+
shell: python
143+
run: |
144+
import urllib.request, json, sys, re
145+
url = 'https://api.github.com/repos/jnbrunet/sofa/actions/artifacts'
146+
req = urllib.request.Request(url)
147+
req.add_header('authorization', 'Bearer ${{ secrets.GITHUB_TOKEN }}')
148+
r = urllib.request.urlopen(req).read()
149+
artifacts = json.loads(r.decode('utf-8'))['artifacts']
150+
os_artifacts = filter(lambda a:re.search('${{ matrix.os }}', a['name'], re.I), artifacts)
151+
last_artifact_url = sorted(os_artifacts, reverse=False, key=lambda a:a['created_at'])[-1]['archive_download_url']
152+
print(f"::set-output name=link::{last_artifact_url}")
132153
133154
- name: Cache SOFA
134155
uses: actions/cache@v2
@@ -139,8 +160,10 @@ jobs:
139160

140161
- name: Download SOFA nightly build
141162
if: steps.sofa_cache.outputs.cache-hit != 'true'
142-
run: curl --output sofa.zip
143-
-u jnbrunet:$TOKEN -L -o sofa.zip /
163+
run: |
164+
curl --output sofa.zip \
165+
--header 'authorization: Bearer ${{ secrets.GITHUB_TOKEN }}' \
166+
-u jnbrunet:$TOKEN -L -o sofa.zip / \
144167
${{ steps.sofa_nightly_link.outputs.link }}
145168
146169
- name: Install SOFA nightly build

bindings/Sofa/tests/Core/BaseData.py

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -137,16 +137,6 @@ def test_DataAsArray2D(self):
137137
self.assertSequenceEqual(list(c.position.value[1]), v[1])
138138
self.assertSequenceEqual(list(c.position.value[2]), v[2])
139139

140-
# @unittest.skip # no reason needed
141-
def test_DataArray2DOperationInPlace(self):
142-
root = Sofa.Core.Node("rootNode")
143-
v = numpy.array([[0, 0, 0], [1, 1, 1], [2, 2, 2], [3, 3, 3]])
144-
c = root.addObject("MechanicalObject", name="t", position=v.tolist())
145-
c.position.value *= 2.0
146-
numpy.testing.assert_array_equal(c.position.array(), v*2.0)
147-
c.position.value += 3.0
148-
numpy.testing.assert_array_equal(c.position.array(), (v*2.0)+3.0)
149-
150140
# @unittest.skip # no reason needed
151141
def test_DataArray2DSetFromList(self):
152142
v = [[0, 0, 0], [1, 1, 1], [2, 2, 2], [3, 3, 3]]

0 commit comments

Comments
 (0)