Skip to content
This repository was archived by the owner on Oct 3, 2024. It is now read-only.

Commit 6447573

Browse files
committed
[#82] Add code coverage job
1 parent 0b7490b commit 6447573

File tree

2 files changed

+22
-12
lines changed

2 files changed

+22
-12
lines changed

.github/workflows/create-release.yml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,11 @@ jobs:
1010
runs-on: ubuntu-latest
1111
steps:
1212
- uses: actions/checkout@v3
13+
- uses: actions/setup-go@v3
14+
with:
15+
go-version: '^1.18'
1316
- name: Build application
1417
run: |
15-
wget https://go.dev/dl/go1.18.3.linux-amd64.tar.gz
16-
sudo rm -rf /usr/local/go && sudo tar -C /usr/local -xzf go1.18.3.linux-amd64.tar.gz
17-
export PATH=$PATH:/usr/local/go/bin
18-
go version
1918
go build
2019
- name: Set short sha
2120
id: vars
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,38 @@
1-
name: Build and test
1+
name: Test
22
on:
33
push:
44

55
jobs:
6-
build-and-test:
7-
name: Build and test
6+
integration:
7+
name: Integration tests
88
runs-on: ubuntu-latest
99
steps:
1010
- uses: actions/checkout@v3
11+
- uses: actions/setup-go@v3
12+
with:
13+
go-version: '^1.18'
1114
- name: Build application
1215
run: |
13-
wget https://go.dev/dl/go1.18.3.linux-amd64.tar.gz
14-
sudo rm -rf /usr/local/go && sudo tar -C /usr/local -xzf go1.18.3.linux-amd64.tar.gz
15-
export PATH=$PATH:/usr/local/go/bin
16-
go version
1716
go build
1817
- name: Build Drupal skeleton with Composer Drupal Project
1918
run: |
2019
composer create-project drupal-composer/drupal-project:9.x-dev drupal --stability dev --no-interaction
21-
2220
- name: Copy application binary and run it
2321
run: |
2422
cp drupal9ci drupal
2523
cd drupal
2624
# We can't test interactive mode here so we pass a CI provider.
2725
./drupal9ci Bitbucket
26+
27+
unit:
28+
name: Unit tests
29+
runs-on: ubuntu-latest
30+
steps:
31+
- uses: actions/checkout@v3
32+
- uses: actions/setup-go@v3
33+
with:
34+
go-version: '^1.18'
35+
- name: Run tests with coverage
36+
run: go test -race -coverprofile=coverage.out -covermode=atomic
37+
- name: Upload coverage to Codecov
38+
uses: codecov/codecov-action@v2

0 commit comments

Comments
 (0)