Skip to content

Commit

Permalink
Add GitHub actions for CMake projects (#40)
Browse files Browse the repository at this point in the history
Created YAML files for 2015 and 2021. Updated existing files for consistency.
  • Loading branch information
kfarnung authored Jun 20, 2022
1 parent 09e4657 commit c2a2e26
Show file tree
Hide file tree
Showing 5 changed files with 94 additions and 17 deletions.
38 changes: 38 additions & 0 deletions .github/workflows/2015.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Advent of Code 2015

on:
push:
branches:
- main
paths:
- .github/workflows/2015.yml
- 2015/**
pull_request:
paths:
- .github/workflows/2015.yml
- 2015/**

jobs:
build-2015:
strategy:
matrix:
os:
- ubuntu-latest
- windows-latest

runs-on: ${{ matrix.os }}
defaults:
run:
working-directory: "2015"

steps:
- uses: actions/checkout@v3

- name: Configure
run: cmake -B build

- name: Build
run: cmake --build build -j 4

- name: Test
run: ctest --test-dir build -j 4
10 changes: 5 additions & 5 deletions .github/workflows/2017.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@ on:
branches:
- main
paths:
- ".github/workflows/2017.yml"
- "2017/**"
- .github/workflows/2017.yml
- 2017/**
pull_request:
paths:
- ".github/workflows/2017.yml"
- "2017/**"
- .github/workflows/2017.yml
- 2017/**

jobs:
build-2017:
Expand All @@ -25,7 +25,7 @@ jobs:
- name: Use Node.js 16.x
uses: actions/setup-node@v1
with:
node-version: "16.x"
node-version: 16.x

- run: npm ci

Expand Down
16 changes: 8 additions & 8 deletions .github/workflows/2018.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,24 +5,24 @@ on:
branches:
- main
paths:
- ".github/workflows/2018.yml"
- "2018/**"
- .github/workflows/2018.yml
- 2018/**
pull_request:
paths:
- ".github/workflows/2018.yml"
- "2018/**"
- .github/workflows/2018.yml
- 2018/**

jobs:
build-2018:
runs-on: ubuntu-latest
defaults:
run:
working-directory: "2018"
strategy:
matrix:
python-version:
- pypy-2.7
- pypy-3.7
runs-on: ubuntu-latest
defaults:
run:
working-directory: "2018"

steps:
- uses: actions/checkout@v2
Expand Down
9 changes: 5 additions & 4 deletions .github/workflows/2020.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,20 @@ on:
branches:
- main
paths:
- ".github/workflows/2020.yml"
- "2020/**"
- .github/workflows/2020.yml
- 2020/**
pull_request:
paths:
- ".github/workflows/2020.yml"
- "2020/**"
- .github/workflows/2020.yml
- 2020/**

jobs:
build-2020:
runs-on: ubuntu-latest
defaults:
run:
working-directory: "2020"

steps:
- uses: actions/checkout@v2

Expand Down
38 changes: 38 additions & 0 deletions .github/workflows/2021.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Advent of Code 2021

on:
push:
branches:
- main
paths:
- .github/workflows/2021.yml
- 2021/**
pull_request:
paths:
- .github/workflows/2021.yml
- 2021/**

jobs:
build-2021:
strategy:
matrix:
os:
- ubuntu-latest
- windows-latest

runs-on: ${{ matrix.os }}
defaults:
run:
working-directory: "2021"

steps:
- uses: actions/checkout@v3

- name: Configure
run: cmake -B build

- name: Build
run: cmake --build build -j 4

- name: Test
run: ctest --test-dir build -j 4

0 comments on commit c2a2e26

Please sign in to comment.