Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .github/workflows/code-linting-checks.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,9 @@ jobs:
lint-check:
strategy:
matrix:
os: ["macos-latest", "ubuntu-latest"]
os:
- "macos-latest"
- "ubuntu-latest"
runs-on: "${{matrix.os}}"
steps:
- uses: "actions/checkout@v4"
Expand Down
55 changes: 55 additions & 0 deletions .github/workflows/unit-tests.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
name: "unit-tests"

on:
pull_request:
push:
schedule:
# Run daily at 00:15 UTC (the 15 is to avoid periods of high load)
- cron: "15 0 * * *"
workflow_dispatch:

permissions: {}

concurrency:
group: "${{github.workflow}}-${{github.ref}}"

# Cancel in-progress jobs for efficiency
cancel-in-progress: true

jobs:
build-ystdlib-cpp:
strategy:
matrix:
os:
- "macos-latest"
- "ubuntu-20.04"
- "ubuntu-22.04"
- "ubuntu-24.04"
runs-on: "${{matrix.os}}"
steps:
- uses: "actions/checkout@v4"
with:
submodules: "recursive"

- uses: "actions/setup-python@v5"
with:
python-version: "3.11"

- name: "Install task"
shell: "bash"
run: "npm install -g @go-task/cli"

- if: "matrix.os == 'macos-latest'"
name: "Install coreutils (for md5sum)"
run: "brew install coreutils"

- name: "Log tool versions"
run: |-
md5sum --version
python --version
tar --version
task --version

# TODO: Change the task to run all unittests once any unittest is added. Until then we check
# that building the project succeeds.
- run: "task build:target"
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,12 @@ Initialize and update submodules:
git submodule update --init --recursive
```

# Building
To build all targets in `ystdlib-cpp`:
```shell
task build:target
```

## Linting
Before submitting a pull request, ensure you’ve run the linting commands below and have fixed all
violations and suppressed all warnings.
Expand Down
1 change: 1 addition & 0 deletions taskfile.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
version: "3"

includes:
build: "./taskfiles/build.yaml"
lint: "./taskfiles/lint.yaml"
utils: "tools/yscope-dev-utils/taskfiles/utils.yml"

Expand Down
27 changes: 27 additions & 0 deletions taskfiles/build.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
version: "3"

tasks:
target:
desc: "Builds ystdlib-cpp."
vars:
TARGETS:
ref: "default (list \"all\") .TARGETS"
deps:
- ":config-cmake-project"
cmds:
- >-
cmake
--build "{{.G_BUILD_DIR}}"
--parallel {{numCPU}}
--target {{range .TARGETS}}{{.}} {{end}}

clean:
desc: "Removes all built artifacts."
deps:
- ":config-cmake-project"
cmds:
- >-
cmake
--build "{{.G_BUILD_DIR}}"
--parallel {{numCPU}}
--target clean
Loading