Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cpp binary search #189

Merged
merged 36 commits into from
Aug 4, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
05aec55
docs: add 12in23 calendar link and current "scores"
vpayno Aug 3, 2023
622aecf
c++/binary-search: download exercise
vpayno Aug 3, 2023
c3d891a
c++/binary-search: 1st iteration
vpayno Aug 3, 2023
8667587
c++/binary-search: 2nd iteration - c header -> c++ header
vpayno Aug 3, 2023
da7122a
c++: update/fix Makefiles - for real this time
vpayno Aug 3, 2023
fed561d
docs: fix the 12in23 table
vpayno Aug 3, 2023
96a9df6
cpp/simple-linked-list: download exercise
vpayno Aug 4, 2023
89360f4
cpp/simple-linked-list: 1st iteration
vpayno Aug 4, 2023
35f9593
cpp/simple-linked-list: 2nd iteration - c header -> c++ header
vpayno Aug 4, 2023
24c32ed
docs: add 12in23 featured languagees and exercises
vpayno Aug 4, 2023
d275080
ci(awk): narrow scope of changed files
vpayno Aug 4, 2023
37dbf0c
ci(common-lisp): narrow scope of changed files
vpayno Aug 4, 2023
407982a
ci(dart): narrow scope of changed files
vpayno Aug 4, 2023
5a9e23b
ci(go): narrow scope of changed files
vpayno Aug 4, 2023
7e8d275
ci(jq): narrow scope of changed files
vpayno Aug 4, 2023
b53c9f3
ci(lua): narrow scope of changed files
vpayno Aug 4, 2023
9563a16
ci(python): narrow scope of changed files
vpayno Aug 4, 2023
08a61b2
ci(rust): narrow scope of changed files
vpayno Aug 4, 2023
f3a448e
ci(tcl): narrow scope of changed files
vpayno Aug 4, 2023
e6da92c
ci(vimscript): narrow scope of changed files
vpayno Aug 4, 2023
4c7d648
ci(bash): format clean up
vpayno Aug 4, 2023
0f6ff98
ci(c): add header comment
vpayno Aug 4, 2023
c2d9ae9
ci(codeql-analysis): format clean up
vpayno Aug 4, 2023
d150fac
ci(c++): format clean up
vpayno Aug 4, 2023
94eb12a
ci(gh-actions): format clean up
vpayno Aug 4, 2023
e2164b8
ci(git-pr): format clean up
vpayno Aug 4, 2023
95e1e1c
ci(links): format clean up
vpayno Aug 4, 2023
13d721c
ci(woke-pr): format clean up
vpayno Aug 4, 2023
fb7f652
ci(woke-push): format clean up
vpayno Aug 4, 2023
25214a7
bash/affine-cipher: update exercise
vpayno Aug 4, 2023
8835e1b
bash/diffie-hellman: update exercise
vpayno Aug 4, 2023
a809dda
bash/forth: update exercise
vpayno Aug 4, 2023
4663fc5
bash/grep: update exercise
vpayno Aug 4, 2023
9cfdf89
bash/poker: update exercise
vpayno Aug 4, 2023
80ae40c
ci(c++): add experimental workflow that uses matrix.exercise to run a…
vpayno Aug 4, 2023
71f88b2
ci(c++): replace old workflow with new parallel workflow
vpayno Aug 4, 2023
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
6 changes: 3 additions & 3 deletions .github/workflows/awk.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
#
# .github/workflows/awk.yml
#
---
name: Awk Workflow
on: # yamllint disable-line rule:truthy
pull_request:
Expand Down Expand Up @@ -31,7 +31,7 @@ jobs:
# Check if the files are present in the changed file list (added, modified, deleted) then output to stdout.
HAS_DIFF=false
printf "=== Which Awk files changed? ===\n"
if printf "%s\n" "${GIT_DIFF}" | grep -E '^(.*[.]awk|.github/workflows/awk.yml)$'; then
if printf "%s\n" "${GIT_DIFF}" | grep -E '^(awk/.*[.]awk|.github/workflows/awk.yml)$'; then
HAS_DIFF=true
fi
printf "\n"
Expand Down Expand Up @@ -112,7 +112,7 @@ jobs:
./for_each ../../.github/citools/awk/awk-bats
- name: Testing with AwkUnit
id: awk-test-run
run: |
run: |-
cd ./awk
# still trying to figure out why this is broken in CI
./for_each ../../.github/citools/awk/awk-test || true
3 changes: 2 additions & 1 deletion .github/workflows/bash.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
---
#
# .github/workflows/bash.yml
#
# https://github.com/reviewdog/action-shellcheck
#
---
name: Bash Checks
on: [pull_request] # yamllint disable-line rule:truthy

jobs:
shellcheck:
runs-on: ubuntu-latest
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/c.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
---
#
# .github/workflows/c.yml
#
name: C Workflow
on: # yamllint disable-line rule:truthy
pull_request:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
---
#
# .github/workflows/codeql-analysis.yml
#
Expand All @@ -12,7 +13,6 @@
# the `language` matrix defined below to confirm you have the correct set of
# supported CodeQL languages.
#
---
name: "CodeQL"
on: # yamllint disable-line rule:truthy
push:
Expand All @@ -22,6 +22,7 @@ on: # yamllint disable-line rule:truthy
branches: ["main"]
schedule:
- cron: '20 17 * * 4'

jobs:
analyze:
name: Analyze
Expand Down Expand Up @@ -53,7 +54,6 @@ jobs:
# Details on CodeQL's query packs refer to:
# https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
# queries: security-extended,security-and-quality

uses: github/codeql-action/autobuild@v2
# ℹ️ Command-line programs to run using the OS shell.
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/common-lisp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:
# Check if the files are present in the changed file list (added, modified, deleted) then output to stdout.
HAS_DIFF=false
printf "=== Which Lisp files changed? ===\n"
if printf "%s\n" "${GIT_DIFF}" | grep -E '^(.*[.]lisp|.github/workflows/common-lisp.yml)'; then
if printf "%s\n" "${GIT_DIFF}" | grep -E '^(common-lisp/.*[.]lisp|.github/workflows/common-lisp.yml)'; then
HAS_DIFF=true
fi
printf "\n"
Expand Down
104 changes: 91 additions & 13 deletions .github/workflows/cpp.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
---
#
# .github/workflows/cpp.yml
#
name: C++ Workflow
on: # yamllint disable-line rule:truthy
pull_request:
Expand Down Expand Up @@ -49,14 +52,79 @@ jobs:
exclude:
- os: "macos-latest"
- os: "windows-latest"
exercise:
- cpp/acronym
- cpp/allergies
- cpp/all-your-base
- cpp/anagram
- cpp/armstrong-numbers
- cpp/atbash-cipher
- cpp/beer-song
- cpp/binary
- cpp/binary-search
- cpp/bob
- cpp/collatz-conjecture
- cpp/darts
- cpp/difference-of-squares
- cpp/election-day
- cpp/ellens-alien-game
- cpp/etl
- cpp/freelancer-rates
- cpp/gigasecond
- cpp/grade-school
- cpp/grains
- cpp/hamming
- cpp/hello-world
- cpp/hexadecimal
- cpp/high-scores
- cpp/interest-is-interesting
- cpp/isbn-verifier
- cpp/isogram
- cpp/largest-series-product
- cpp/lasagna
- cpp/last-will
- cpp/leap
- cpp/log-levels
- cpp/luhn
- cpp/making-the-grade
- cpp/matching-brackets
- cpp/meetup
- cpp/nth-prime
- cpp/nucleotide-count
- cpp/pacman-rules
- cpp/pangram
- cpp/pascals-triangle
- cpp/perfect-numbers
- cpp/phone-number
- cpp/prime-factors
- cpp/protein-translation
- cpp/raindrops
- cpp/reverse-string
- cpp/rna-transcription
- cpp/robot-name
- cpp/robot-simulator
- cpp/roman-numerals
- cpp/scrabble-score
- cpp/secret-handshake
- cpp/series
- cpp/sieve
- cpp/simple-linked-list
- cpp/space-age
- cpp/sum-of-multiples
- cpp/triangle
- cpp/trinary
- cpp/troll-the-trolls
- cpp/two-fer
- cpp/vehicle-purchase
- cpp/word-count
runs-on: "${{ matrix.os }}"
needs: [stage1]
if: needs.stage1.outputs.docs_changed == 'True'
steps:
- name: Checkout Repo
- name: Checkout Repo [${{ matrix.exercise }}]
id: checkout-repo
uses: actions/checkout@v3
- name: Install C++ Tools
- name: Install C++ Tools [${{ matrix.exercise }}]
id: install-c-tools
run: |
sudo tee -a /etc/apt/sources.list <<EOF
Expand All @@ -80,27 +148,37 @@ jobs:
# sudo apt install -y lcov
sudo apt install -y make
sudo apt install -y libboost-all-dev
- name: CD to C++ Dir
- name: CD to C++ Dir [${{ matrix.exercise }}]
id: cd-to-c-dir
run: |
pwd
ls
cd ./cpp
cd "./${{ matrix.exercise }}"
pwd
ls
- name: Analysing the code with clang-check
ls
- name: Analysing the code with clang-check [${{ matrix.exercise }}]
id: clang-check-16
run: |
cd ./cpp
./for_each ../../.github/citools/cpp/clang-check
- name: Analysing the code clang-tidy-16
pwd
cd "./${{ matrix.exercise }}"
pwd
ls
../../.github/citools/cpp/clang-check
- name: Analysing the code clang-tidy-16 [${{ matrix.exercise }}]
id: clang-tidy-16
run: |
cd ./cpp
./for_each ../../.github/citools/cpp/clang-tidy
- name: Run Unit Tests with Coverage
pwd
cd "./${{ matrix.exercise }}"
pwd
ls
../../.github/citools/cpp/clang-tidy
- name: Run Unit Tests with Coverage [${{ matrix.exercise }}]
id: make-test
run: |-
cd ./cpp
pwd
cd "./${{ matrix.exercise }}"
pwd
ls
export LDFLAGS="-lgcov --coverage" CXXFLAGS="--coverage"
./for_each make coverage
make coverage
2 changes: 1 addition & 1 deletion .github/workflows/dart.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:
# Check if the files are present in the changed file list (added, modified, deleted) then output to stdout.
HAS_DIFF=false
printf "=== Which Dart files changed? ===\n"
if printf "%s\n" "${GIT_DIFF}" | grep -E '^(.*[.]dart|.*/pubspec[.].*|.github/workflows/dart.yml)$'; then
if printf "%s\n" "${GIT_DIFF}" | grep -E '^(dart/.*[.]dart|dart/.*/pubspec[.].*|.github/workflows/dart.yml)$'; then
HAS_DIFF=true
fi
printf "\n"
Expand Down
7 changes: 5 additions & 2 deletions .github/workflows/gh-actions.yml
Original file line number Diff line number Diff line change
@@ -1,20 +1,23 @@
---
#
# .github/woorkflows/gh-actions.yml
#
# https://github.com/reviewdog/action-actionlint
---
name: GitHub Action Workflow
on: # yamllint disable-line rule:truthy
push:
branches:
- main
- develop
pull_request:

env:
REVIEWDOG_GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }}

defaults:
run:
shell: bash

jobs:
stage1:
name: Change Check
Expand Down Expand Up @@ -95,7 +98,7 @@ jobs:
actionlint --version
- name: Analyzing the code with actionlint
id: actionlint
run: |
run: |-
echo "::add-matcher::.github/actionlint-matcher.json"
for f in ./.github/workflows/*yml; do
printf "Running: actionlint %s\n" "${f}"
Expand Down
5 changes: 3 additions & 2 deletions .github/workflows/git-pr.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
---
#
# .github/workflows/git-pr.yml
#
---
name: Git PR Checks
on: [pull_request] # yamllint disable-line rule:truthy

jobs:
block-fixup:
runs-on: ubuntu-latest
Expand All @@ -26,5 +27,5 @@ jobs:
git diff --name-only HEAD^..
- name: Get Log Diff
id: git-log-diff
run: |
run: |-
git log --color=auto --graph --pretty=format:'%Cred%<(8)%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an> [%ce] %Creset%C(cyan)[gpg: %G?]%Creset' --abbrev-commit --decorate HEAD^..
7 changes: 4 additions & 3 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
---
#
# .github/workflows/go.yml
#
---
name: Go Workflow
on: # yamllint disable-line rule:truthy
pull_request:

jobs:
stage1:
name: Change Check
Expand All @@ -31,7 +32,7 @@ jobs:
# Check if the files are present in the changed file list (added, modified, deleted) then output to stdout.
HAS_DIFF=false
printf "=== Which Golang files changed? ===\n"
if printf "%s\n" "${GIT_DIFF}" | grep -E '^(.*[.]go|.*/go[.](sum|mod)|.github/workflows/go.yml)'; then
if printf "%s\n" "${GIT_DIFF}" | grep -E '^(go/.*[.]go|go/.*/go[.](sum|mod)|.github/workflows/go.yml)'; then
HAS_DIFF=true
fi
printf "\n"
Expand Down Expand Up @@ -108,6 +109,6 @@ jobs:
git restore ./*/coverage.out
- name: Testing with gosec
id: go-test-security
run: |
run: |-
cd ./go
gosec ./...
7 changes: 4 additions & 3 deletions .github/workflows/jq.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
---
#
# .github/workflows/jq.yml
#
---
name: jq Workflow
on: # yamllint disable-line rule:truthy
pull_request:

jobs:
stage1:
name: Change Check
Expand All @@ -31,7 +32,7 @@ jobs:
# Check if the files are present in the changed file list (added, modified, deleted) then output to stdout.
HAS_DIFF=false
printf "=== Which jq files changed? ===\n"
if printf "%s\n" "${GIT_DIFF}" | grep -E '^(.*[.]jq|.github/workflows/jq.yml)$'; then
if printf "%s\n" "${GIT_DIFF}" | grep -E '^(jq/.*[.]jq|.github/workflows/jq.yml)$'; then
HAS_DIFF=true
fi
printf "\n"
Expand Down Expand Up @@ -84,6 +85,6 @@ jobs:
ls
- name: Testing with Bats tests
id: jq-bats-run
run: |
run: |-
cd ./jq
./for_each ../../.github/citools/jq/jq-bats
3 changes: 2 additions & 1 deletion .github/workflows/links.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
---
#
# .github/workflows/links.yml
#
# https://github.com/lycheeverse/lychee-action
#
---
name: Check Links
on: # yamllint disable-line rule:truthy
push:
branches:
- main
- develop
pull_request:

jobs:
linkChecker:
runs-on: ubuntu-latest
Expand Down
7 changes: 4 additions & 3 deletions .github/workflows/lua.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
---
#
# .github/workflows/lua.yml
#
---
name: Lua Workflow
on: # yamllint disable-line rule:truthy
pull_request:

jobs:
stage1:
name: Change Check
Expand All @@ -31,7 +32,7 @@ jobs:
# Check if the files are present in the changed file list (added, modified, deleted) then output to stdout.
HAS_DIFF=false
printf "=== Which Lua files changed? ===\n"
if printf "%s\n" "${GIT_DIFF}" | grep -E '^(.*[.]lua|.github/workflows/lua.yml)$'; then
if printf "%s\n" "${GIT_DIFF}" | grep -E '^(lua/.*[.]lua|.github/workflows/lua.yml)$'; then
HAS_DIFF=true
fi
printf "\n"
Expand Down Expand Up @@ -111,7 +112,7 @@ jobs:
./for_each busted --coverage --lpath="" --cpath="" --output=gtest -Xoutput --color
- name: Coverage Report
id: lua-coverage-report
run: |
run: |-
cd ./lua
./for_each luacov .
./for_each luacov-console .
Expand Down
Loading
Loading