Skip to content

[stdlib] Better Dict benchmarks #3134

[stdlib] Better Dict benchmarks

[stdlib] Better Dict benchmarks #3134

# ===----------------------------------------------------------------------=== #
# Copyright (c) 2024, Modular Inc. All rights reserved.
#
# Licensed under the Apache License v2.0 with LLVM Exceptions:
# https://llvm.org/LICENSE.txt
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# ===----------------------------------------------------------------------=== #
name: Test stdlib and examples
on:
pull_request:
types: [opened, synchronize, reopened, ready_for_review]
workflow_dispatch:
permissions:
contents: read
pull-requests: read
jobs:
test-examples:
name: with ${{ matrix.os }} and assertions=${{ matrix.mojo-enable-assertions }}
strategy:
fail-fast: false
matrix:
os: ["ubuntu-latest", "macos-14"]
mojo-enable-assertions: [0, 1]
runs-on: ${{ matrix.os }}
timeout-minutes: 30
defaults:
run:
shell: bash
env:
DEBIAN_FRONTEND: noninteractive
steps:
- name: Checkout repo
uses: actions/checkout@v4
- name: Download Modular installer
run: |
curl -s https://get.modular.com | sh -
- name: Install nightly Mojo compiler
run: |
# The <auth_token> of "examples" is arbitrary but something
# needs to be provided.
modular auth examples
modular install nightly/mojo
# Put Mojo on the PATH
echo "MODULAR_HOME=$HOME/.modular" >> $GITHUB_ENV
echo "$HOME/.modular/pkg/packages.modular.com_nightly_mojo/bin" >> $GITHUB_PATH
- name: Install build tools (Linux)
if: ${{ matrix.os == 'ubuntu-latest' }}
run: |
./stdlib/scripts/install-build-tools-linux.sh
- name: Install build tools (macOS)
if: ${{ matrix.os == 'macos-14' }}
run: |
./stdlib/scripts/install-build-tools-macos.sh
- name: Run standard library tests and examples
env:
MOJO_ENABLE_ASSERTIONS_IN_TESTS: ${{ matrix.mojo-enable-assertions }}
run: |
./stdlib/scripts/run-tests.sh
./examples/run-examples.sh