-
-
Notifications
You must be signed in to change notification settings - Fork 0
57 lines (45 loc) · 1.57 KB
/
test.yml
File metadata and controls
57 lines (45 loc) · 1.57 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
name: Test
on:
push:
branches:
- main
- master
pull_request:
jobs:
test:
runs-on: self-hosted
strategy:
fail-fast: false
matrix:
python-version: ["3.11"]
name: Python ${{ matrix.python-version }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: 18
- name: Install @devcontainers/cli
run: npm install --location=global @devcontainers/cli@0.41.0
- name: Start Dev Container
env:
DOCKER_BUILDKIT: 1
run: |
git config --global init.defaultBranch main
PYTHON_VERSION=${{ matrix.python-version }} devcontainer up --workspace-folder .
- name: Lint package
run: devcontainer exec --workspace-folder . poe lint
- name: Test package
run: devcontainer exec --workspace-folder . poe test
# Copiar coverage.xml para o sistema de arquivos do host
- name: Copy coverage report from Dev Container to Host
run: |
CONTAINER_ID=$(docker ps -qf "ancestor=soar_dev") # Substitua IMAGE_NAME pelo nome da imagem do seu Dev Container
docker cp "$CONTAINER_ID:/workspaces/soar/reports/coverage.xml" "${GITHUB_WORKSPACE}/coverage.xml"
# Passo do Codecov ajustado para o novo local do arquivo
- uses: codecov/codecov-action@v4
with:
fail_ci_if_error: true
files: ./coverage.xml # Este é o arquivo no sistema de arquivos do host
token: ${{ secrets.CODECOV_TOKEN }}