Run tests #1023
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: Run tests | |
on: | |
push: | |
branches: | |
- master | |
- testing/** | |
pull_request: | |
branches: | |
- master | |
schedule: | |
# Every day at 3:05 AM UTC | |
- cron: '5 3 * * *' | |
workflow_dispatch: | |
# needed to allow julia-actions/cache to delete old caches that it has created | |
permissions: | |
actions: write | |
contents: read | |
concurrency: | |
# group by workflow and ref; the last slightly strange component ensures that for pull | |
# requests, we limit to 1 concurrent job, but for the master branch we don't | |
group: ${{ github.workflow }}-${{ github.ref }}-${{ github.ref != 'refs/heads/master' || github.run_number }} | |
# Cancel intermediate builds, but only if it is a pull request build. | |
cancel-in-progress: ${{ startsWith(github.ref, 'refs/pull/') }} | |
jobs: | |
# github services (for mongodb service) only works on linux | |
test-with-mongodb: | |
runs-on: ${{ matrix.os }} | |
continue-on-error: ${{ matrix.julia-version == '1.11-nightly' || matrix.julia-version == 'nightly' }} | |
strategy: | |
matrix: | |
julia-version: | |
- '~1.6.0-0' | |
- '~1.10.0-0' | |
- '1.11-nightly' | |
- 'nightly' | |
os: ['ubuntu-latest'] | |
cxxwrap: [ '0.14', '0.16' ] | |
fail-fast: false | |
# Service containers to run | |
services: | |
# Label used to access the service container | |
mongodb: | |
# Docker Hub image | |
image: mongo:6.0 | |
# Provide the login data | |
env: | |
MONGO_INITDB_ROOT_USERNAME: admin | |
MONGO_INITDB_ROOT_PASSWORD: admin | |
ports: | |
# Maps tcp port 27017 on service container to the host | |
- 27017:27017 | |
env: | |
JULIA_PKG_SERVER: "" | |
POLYDB_TEST_URI: "mongodb://admin:admin@localhost:27017/?authSource=admin" | |
steps: | |
- uses: actions/checkout@v4 | |
- name: "Set up Julia" | |
uses: julia-actions/setup-julia@v2 | |
with: | |
version: ${{ matrix.julia-version }} | |
- uses: julia-actions/cache@v2 | |
with: | |
cache-name: julia-cache;workflow=${{ github.workflow }};julia=${{ matrix.julia-version }};arch=${{ runner.arch }} | |
include-matrix: false | |
cache-scratchspaces: false | |
- name: "pin CxxWrap" | |
if: matrix.cxxwrap != '' | |
run: julia --project -e 'using Pkg; pkg"add CxxWrap@${{ matrix.cxxwrap }}"; pkg"pin CxxWrap";' | |
- name: "Fill polyDB container" | |
run: | | |
wget -qO - https://www.mongodb.org/static/pgp/server-6.0.asc | sudo apt-key add - | |
echo "deb [ arch=amd64 ] https://repo.mongodb.org/apt/ubuntu jammy/mongodb-org/6.0 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-6.0.list | |
sudo apt-get update | |
sudo apt-get install -y mongodb-database-tools | |
mongorestore --host localhost -u admin -p admin --port 27017 .github/polydb_dump | |
- uses: julia-actions/julia-runtest@v1 | |
- uses: julia-actions/julia-processcoverage@v1 | |
- uses: codecov/codecov-action@v4 | |
with: | |
file: ./lcov.info | |
flags: unittests | |
name: codecov-umbrella | |
fail_ci_if_error: false | |
token: ${{ secrets.CODECOV_TOKEN }} | |
# this one is only for macos, ubuntu is run with mongodb in the other job | |
test: | |
runs-on: ${{ matrix.os }} | |
continue-on-error: ${{ matrix.julia-version == '1.11-nightly' || matrix.julia-version == 'nightly' }} | |
env: | |
JULIA_PKG_SERVER: "" | |
strategy: | |
matrix: | |
julia-version: | |
- '1.10' | |
- '1.11-nightly' | |
- 'nightly' | |
os: [ 'macos-14' ] # aarch64 | |
cxxwrap: [ '' ] | |
include: | |
- os: 'macos-13' # x86_64 | |
julia-version: '1.6' | |
cxxwrap: '' | |
- os: 'macos-14' # x86_64 | |
julia-version: '1.10' | |
cxxwrap: '0.14' | |
fail-fast: false | |
steps: | |
- uses: actions/checkout@v4 | |
- name: "Set up Julia" | |
uses: julia-actions/setup-julia@v2 | |
with: | |
version: ${{ matrix.julia-version }} | |
- uses: julia-actions/cache@v2 | |
with: | |
cache-name: julia-cache;workflow=${{ github.workflow }};julia=${{ matrix.julia-version }};arch=${{ runner.arch }} | |
include-matrix: false | |
cache-scratchspaces: false | |
- name: "pin CxxWrap" | |
if: matrix.cxxwrap != '' | |
run: julia --project -e 'using Pkg; pkg"add CxxWrap@${{ matrix.cxxwrap }}"; pkg"pin CxxWrap";' | |
- uses: julia-actions/julia-runtest@v1 | |
- uses: julia-actions/julia-processcoverage@v1 | |
- uses: codecov/codecov-action@v4 | |
with: | |
file: ./lcov.info | |
flags: unittests | |
name: codecov-umbrella | |
fail_ci_if_error: false | |
token: ${{ secrets.CODECOV_TOKEN }} |