-
Notifications
You must be signed in to change notification settings - Fork 1
68 lines (54 loc) · 1.74 KB
/
test.yml
File metadata and controls
68 lines (54 loc) · 1.74 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
name: Test
on:
push:
branches:
- '**'
tags:
- 'v*'
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: Extract branch name
shell: bash
run: echo "tag=$(echo ${GITHUB_REF#refs/heads/} | tr / -)" >> $GITHUB_OUTPUT
id: extract_branch
- name: "Pull core image"
shell: bash
run: |
if docker pull tomlegkov/marine-core:${{ steps.extract_branch.outputs.tag }} > /dev/null 2>&1; then
echo "tag=${{ steps.extract_branch.outputs.tag }}" >> $GITHUB_OUTPUT
else
echo "tag=marine" >> $GITHUB_OUTPUT
fi
id: detect_tag
- name: Extract version from tag
if: startsWith(github.ref, 'refs/tags/v')
run: echo "version=${GITHUB_REF#refs/tags/v}" >> $GITHUB_OUTPUT
id: extract_version
- name: "Build marine-python docker image"
run: docker build --build-arg MARINE_CORE_TAG=${{ steps.detect_tag.outputs.tag }} --build-arg MARINE_VERSION=${{ steps.extract_version.outputs.version || '0.0.0' }} --pull -t marine-python .
- name: "Extract wheel from docker image"
run: docker run -i --rm -v $(pwd)/dist:/io marine-python sh -c "cp /dist/marine*.whl /io/"
- uses: actions/upload-artifact@v6
with:
name: wheel
path: dist/*.whl
- name: "Run marine-python tests"
run: docker run -i --rm marine-python
release:
needs: test
if: startsWith(github.ref, 'refs/tags/v')
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/download-artifact@v6
with:
name: wheel
- name: Create GitHub Release
uses: softprops/action-gh-release@v2
with:
files: '*.whl'
generate_release_notes: true