-
Notifications
You must be signed in to change notification settings - Fork 0
104 lines (90 loc) · 3 KB
/
Copy pathcontinuous-integration.yaml
File metadata and controls
104 lines (90 loc) · 3 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
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
name: Continuous Integration
on:
push:
jobs:
build-deps-image:
uses: ./.github/workflows/build-deps-image.yaml
permissions:
contents: read
packages: write
lint:
name: Lint
needs: build-deps-image
runs-on: ubuntu-latest
container:
image: ${{ needs.build-deps-image.outputs.image }}
credentials:
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
steps:
- name: Configure git
run: git config --global --add safe.directory "${GITHUB_WORKSPACE}"
- name: Checkout repository
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
git init -b main
remote_url="https://x-access-token:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}.git"
if git remote get-url origin >/dev/null 2>&1; then
git remote set-url origin "${remote_url}"
else
git remote add origin "${remote_url}"
fi
git fetch --depth=1 origin "${GITHUB_SHA}"
git checkout --force FETCH_HEAD
- name: Lint code
run: ./workflow.cmd lint
test:
name: Test (tox matrix)
needs: build-deps-image
runs-on: ubuntu-latest
container:
image: ${{ needs.build-deps-image.outputs.image }}
credentials:
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
steps:
- name: Configure git
run: git config --global --add safe.directory "${GITHUB_WORKSPACE}"
- name: Checkout repository
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
git init -b main
remote_url="https://x-access-token:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}.git"
if git remote get-url origin >/dev/null 2>&1; then
git remote set-url origin "${remote_url}"
else
git remote add origin "${remote_url}"
fi
git fetch --depth=1 origin "${GITHUB_SHA}"
git checkout --force FETCH_HEAD
- name: Run tests
run: ./workflow.cmd test.tox
build:
name: Build
needs: build-deps-image
runs-on: ubuntu-latest
container:
image: ${{ needs.build-deps-image.outputs.image }}
credentials:
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
steps:
- name: Configure git
run: git config --global --add safe.directory "${GITHUB_WORKSPACE}"
- name: Checkout repository
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
git init -b main
remote_url="https://x-access-token:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}.git"
if git remote get-url origin >/dev/null 2>&1; then
git remote set-url origin "${remote_url}"
else
git remote add origin "${remote_url}"
fi
git fetch --depth=1 origin "${GITHUB_SHA}"
git checkout --force FETCH_HEAD
- name: Build package
run: ./workflow.cmd build