ci: test on amd64 and arm64 #13
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Tests | |
on: | |
push: | |
branches: | |
- master | |
pull_request: | |
jobs: | |
build-ui: | |
uses: ./.github/workflows/build-ui.yml | |
tests: | |
name: Tests | |
needs: build-ui | |
strategy: | |
matrix: | |
os: [ubuntu-latest, windows-latest, macos-13, macos-14] | |
runs-on: ${{ matrix.os }} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Setup Go | |
uses: actions/setup-go@v5 | |
with: | |
go-version: stable | |
cache: true | |
check-latest: true | |
- name: Add python dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install -r scripts/requirements.txt | |
- name: Download UI file | |
uses: actions/download-artifact@v4 | |
with: | |
name: ui | |
- name: Move UI file | |
run: mv index.html internal/ui/index.html | |
- name: Prepare coverage dir | |
run: | | |
mkdir -p covdata | |
mkdir -p covdata/unit | |
mkdir -p covdata/integration | |
- name: Cache test binaries | |
uses: actions/cache@v4 | |
with: | |
path: ${{ runner.workspace }}/scripts/bins | |
key: ${{ hashFiles('scripts/tests.py') }} | |
enableCrossOsArchive: true | |
- name: Run tests | |
run: python scripts/tests.py --cockroachdb | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Upload coverage | |
uses: codecov/[email protected] | |
with: | |
token: ${{ secrets.CODECOV_TOKEN }} | |
slug: Zxilly/go-size-analyzer | |
verbose: true | |
file: profile.txt | |
- name: Upload results | |
uses: actions/upload-artifact@v4 | |
with: | |
name: ${{ matrix.os }}-results | |
path: results/ |