-
Notifications
You must be signed in to change notification settings - Fork 138
67 lines (63 loc) · 2.18 KB
/
test-unit.yaml
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
name: Func Unit Test
on: [pull_request]
jobs:
test:
name: Unit Test
strategy:
matrix:
java: [21]
os: ["ubuntu-latest", "windows-latest", "macos-latest"]
runs-on: ${{ matrix.os }}
steps:
- name: Install Bash 4 on Mac
if: matrix.os == 'macos-latest'
run: |
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
brew update
brew install bash
brew install gnu-sed
echo "/usr/local/bin" >> $GITHUB_PATH
echo "$(brew --prefix)/opt/gnu-sed/libexec/gnubin" >> $GITHUB_PATH
- run: git config --global core.autocrlf false
- uses: actions/checkout@v4
- uses: knative/actions/setup-go@main
- uses: actions/setup-java@v4
with:
java-version: ${{ matrix.java }}
distribution: 'temurin'
- uses: actions-rust-lang/setup-rust-toolchain@v1
- name: Core Unit Tests
run: make test
env:
FUNC_REPO_REF: ${{ github.event.pull_request.head.repo.full_name }}
FUNC_REPO_BRANCH_REF: ${{ github.head_ref }}
- name: Template Unit Tests on Ubuntu
if: matrix.os == 'ubuntu-latest'
run: |
python3 -m venv ${{ github.workspace }}/.venv
. ${{ github.workspace }}/.venv/bin/activate
make test-templates
- name: Template Unit Tests
if: matrix.os != 'ubuntu-latest'
run: make test-templates
- name: "Archive code coverage results"
uses: actions/upload-artifact@v4
with:
name: coverage-${{ matrix.os }}
path: ./coverage.txt
retention-days: 1
upload-coverage:
needs: [test]
name: "Upload coverage"
runs-on: "ubuntu-latest"
steps:
- uses: actions/checkout@v4
- name: Download Coverage
run: |
gh run download -R ${{ github.repository }} ${{ github.run_id }}
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- uses: codecov/codecov-action@v4
with:
files: ./coverage-ubuntu-latest/coverage.txt,./coverage-windows-latest/coverage.txt,./coverage-macos-latest/coverage.txt
flags: unit-tests