timeouts use Dates.TimePeriod #598
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: Benchmarks | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
timeout-minutes: 5 | |
strategy: | |
matrix: | |
julia-version: ['1.10'] | |
julia-arch: [x64] | |
nats-version: ['2.10.18'] | |
julia-num-threads: ['1', '1,1', '2,1', '1,2'] # TODO: add ['1,4', '4,4'], but it require large runner, default there are only 2 cores. | |
os: [ubuntu-latest] | |
services: | |
nats: | |
image: nats:${{ matrix.nats-version }} | |
ports: | |
- 4222:4222 | |
steps: | |
- name: "Start reply service" | |
run: | | |
docker ps | |
name=`docker create --network ${{ job.container.network }} -e GITHUB_ACTIONS=true -e CI=true --entrypoint nats synadia/nats-box:latest --server nats:4222 reply help.please 'OK, I CAN HELP!!!'` | |
container_id=`docker container start $name` | |
sleep 2 | |
docker logs $container_id | |
- name: Benchmark NATS with CLI | |
run: | | |
docker run --network ${{ job.container.network }} --entrypoint nats synadia/nats-box:latest --server nats:4222 bench foo --pub 1 --size 16 | |
docker run --network ${{ job.container.network }} --entrypoint nats synadia/nats-box:latest --server nats:4222 bench foo --pub 1 --sub 1 --size 16 | |
- uses: actions/checkout@v2 | |
- uses: julia-actions/setup-julia@v1 | |
with: | |
version: ${{ matrix.julia-version }} | |
arch: ${{ matrix.julia-arch }} | |
- run: | | |
julia --project -e 'using Pkg; Pkg.instantiate()' | |
TEST_JOB_CONTAINER_NETWORK=${{ job.container.network }} JULIA_NUM_THREADS=${{ matrix.julia-num-threads }} julia --color=yes --code-coverage=user --project test/benchmarks.jl | |
- uses: julia-actions/julia-processcoverage@v1 | |
# annotate: true | |
- name: Upload coverage reports to Codecov | |
uses: codecov/codecov-action@v4 | |
env: | |
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} | |
- name: "Stop services" | |
run: | | |
docker kill $(docker ps -q ) | |