Add OSS CI scaffolding (#74) #1
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
# Copyright (c) Meta Platforms, Inc. and affiliates. | |
# All rights reserved. | |
# This source code is licensed under the BSD-style license found in the | |
# LICENSE file in the root directory of this source tree. | |
# This workflow is used for DCPerf CI. | |
name: DCPerf CI (Generic Runner) | |
on: | |
# PR Trigger | |
# | |
pull_request: | |
branches: | |
- main | |
# Push Trigger (enable to catch errors coming out of multiple merges) | |
# | |
push: | |
branches: | |
- main | |
# Manual Trigger | |
# | |
workflow_dispatch: | |
concurrency: | |
# Cancel previous runs in the PR if a new commit is pushed | |
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} | |
cancel-in-progress: true | |
jobs: | |
# Build on CPU hosts (generic GitHub runners) | |
build_artifact: | |
runs-on: ${{ matrix.host-machine.instance }} | |
container: | |
image: amazonlinux:2023 | |
options: --user root --privileged --pid=host | |
volumes: | |
- /var/run/docker.sock:/var/run/docker.sock | |
defaults: | |
run: | |
shell: bash | |
env: | |
PRELUDE: .github/scripts/setup_env.bash | |
continue-on-error: true | |
strategy: | |
fail-fast: false | |
matrix: | |
host-machine: [ | |
{ arch: x86, instance: "ubuntu-latest" }, | |
] | |
python-version: [ "3.9", "3.10", "3.11", "3.12", "3.13" ] | |
steps: | |
- name: Setup Build Container | |
run: yum update -y; yum install -y binutils findutils git pciutils sudo tar wget which | |
- name: Checkout the Repository | |
uses: actions/checkout@v4 | |
with: | |
submodules: true | |
- name: Free Disk Space on Host | |
run: . $PRELUDE; free_disk_space_on_host | |
- name: Display System Info | |
run: . $PRELUDE; print_system_info | |
- name: Setup Miniconda | |
run: . $PRELUDE; setup_miniconda $HOME/miniconda | |
- name: Create Conda Environment | |
run: . $PRELUDE; create_conda_environment $BUILD_ENV ${{ matrix.python-version }} | |
- name: Install Django | |
run: . $PRELUDE; install_django $BUILD_ENV |