This repository has been archived by the owner on Mar 24, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
131 lines (125 loc) · 3.62 KB
/
test_and_build.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
name: test et build
on:
push:
branches:
- master
- dev
tags:
- 'v*'
pull_request:
branches:
- dev
- master
env:
CODECOV_TOKEN: b12c1d6f-032c-40bf-ab16-3cc301e48115
jobs:
TestAndBuild:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os : [ubuntu-20.04, windows-2019]
python: ['3.10']
env:
DISPLAY: ':99.0'
steps:
- name: get repo
uses: actions/checkout@v1
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: ${{matrix.python}}
- name: setup linux
if: runner.os == 'Linux'
run: |
sudo apt update
sudo apt install -y language-pack-fr pulseaudio libmtdev1 xclip
/sbin/start-stop-daemon --start --quiet --pidfile /tmp/custom_xvfb_99.pid --make-pidfile --background --exec /usr/bin/Xvfb -- :99 -screen 0 1280x720x24 -ac +extension GLX
- name: install dev env
run: python run.py install
- name: Tests
run: python run.py test
- name: Coverage
if: runner.os == 'Linux'
run: python run.py cov
- name: build
run: |
python run.py create
briefcase build
- name: Package Windows
if: runner.os == 'Windows'
run: briefcase package
- name: check executable
run: python run.py test_executable
- name: upload on Linux binary in artifact
if: runner.os == 'Linux'
uses: actions/upload-artifact@v2
with:
path: |
linux/mydevoirs
linux/mydevoirs*.AppImage
# name: MyDevoirs-${{runner.os}}64
- name: upload on Windows binary in artifact
if: runner.os == 'Windows'
uses: actions/upload-artifact@v2
with:
path: |
windows/mydevoirs
windows/mydevoirs*.msi
# name: MyDevoirs-${{runner.os}}64
Create_release:
needs: TestAndBuild
runs-on: ubuntu-latest
if: startsWith(github.event.ref, 'refs/tags/v')
steps:
- name: Download artifact binary
uses: actions/download-artifact@v2
with:
path: .
- name: new latest release on master
uses: "marvinpinto/action-automatic-releases@latest"
if: github.ref == 'refs/heads/master'
with:
repo_token: "${{ secrets.GITHUB_TOKEN }}"
prerelease: false
automatic_release_tag: "latest"
title: "MyDevoirs Latest"
files: |
artifact/mydevoirs*.msi
artifact/mydevoirs*.AppImage
- name: Display structure of downloaded files
run: ls -R
working-directory: .
- name: new tag release
uses: "marvinpinto/action-automatic-releases@latest"
if: contains(github.ref, '/tags/')
with:
repo_token: "${{ secrets.GITHUB_TOKEN }}"
prerelease: false
files: |
artifact/mydevoirs*.msi
artifact/mydevoirs*.AppImage
#
# Deploy:
# name: release github
# needs: [Test_linux, Test_windows]
# runs-on: ubuntu-latest
# if: ! contains(github.ref, "vrefs")
# steps:
# - name: Download windows binary
# uses: actions/download-artifact@v1
# with:
# name: MyDevoirs.exe
# - name: Download Linux binary
# uses: actions/download-artifact@v1
# with:
# name: MyDevoirs
# - name: release git_hub
# uses: xresloader/upload-to-github-release@v1
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# with:
# file: "MyDevoirs;MyDevoirs.exe"
# tags: true
# draft: False
# release_name: MyDevoirs v${{github.ref}}
# tag_name: v${{github.ref}}