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

feat: add support for actions/cache #22

Merged
merged 9 commits into from
Sep 3, 2022
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
179 changes: 102 additions & 77 deletions .github/workflows/test-cmake.yml
Original file line number Diff line number Diff line change
@@ -1,89 +1,114 @@
name: CMake

on:
push:
paths:
- ".github/workflows/test-cmake.yml"
- "dist/**"
- "action.yml"
- "test/**"
pull_request:
paths:
- ".github/workflows/test-cmake.yml"
- "dist/**"
- "action.yml"
- "test/**"
on:
push:
paths:
- '.github/workflows/test-cmake.yml'
- 'dist/**'
- 'action.yml'
- 'test/**'
pull_request:
paths:
- '.github/workflows/test-cmake.yml'
- 'dist/**'
- 'action.yml'
- 'test/**'

env:
BUILD_TYPE: Debug
BUILD_TYPE: Debug

jobs:
build:
runs-on: ${{ matrix.os }}

strategy:
matrix:
include:
- os: ubuntu-20.04
COMPILER: gcc
PLATFORM: 20.04
ARCH: x86
- os: ubuntu-20.04
COMPILER: gcc
PLATFORM: 20.04
ARCH: aarch64
- os: windows-2019
COMPILER: msvc
PLATFORM: 2019
ARCH: x86
- os: windows-2019
COMPILER: mingw
PLATFORM: 2019
ARCH: x86
build:
runs-on: ${{ matrix.os }}

steps:
- uses: actions/checkout@v2
- name: Install boost
uses: ./
id: install-boost
with:
boost_version: 1.79.0
platform_version: ${{matrix.PLATFORM}}
toolset: ${{matrix.COMPILER}}
arch: ${{matrix.ARCH}}
strategy:
matrix:
include:
- os: ubuntu-20.04
COMPILER: gcc
PLATFORM: 20.04
ARCH: x86
cache: false
- os: ubuntu-20.04
COMPILER: gcc
PLATFORM: 20.04
ARCH: aarch64
cache: false
- os: windows-2019
COMPILER: msvc
PLATFORM: 2019
ARCH: x86
cache: false
- os: windows-2019
COMPILER: mingw
PLATFORM: 2019
ARCH: x86
cache: false
- os: ubuntu-20.04
COMPILER: gcc
PLATFORM: 20.04
ARCH: x86
cache: true
- os: ubuntu-20.04
COMPILER: gcc
PLATFORM: 20.04
ARCH: aarch64
cache: true
- os: windows-2019
COMPILER: msvc
PLATFORM: 2019
ARCH: x86
cache: true
- os: windows-2019
COMPILER: mingw
PLATFORM: 2019
ARCH: x86
cache: true

- name: Setup MinGW
uses: egor-tensin/setup-mingw@v2
if: ${{runner.os == 'Windows' && matrix.COMPILER == 'mingw'}}
steps:
- uses: actions/checkout@v2
- name: Install boost
uses: ./
id: install-boost
with:
boost_version: 1.79.0
platform_version: ${{matrix.PLATFORM}}
toolset: ${{matrix.COMPILER}}
arch: ${{matrix.ARCH}}
cache: ${{matrix.cache}}

- name: Install arm64 compiler
run: sudo apt-get update && sudo apt-get install gcc-aarch64-linux-gnu g++-aarch64-linux-gnu -y
if: matrix.ARCH == 'aarch64'
- name: Setup MinGW
uses: egor-tensin/setup-mingw@v2
if: ${{runner.os == 'Windows' && matrix.COMPILER == 'mingw'}}

- name: Configure CMake mingw
shell: bash
working-directory: test
run: cmake . -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DBoost_LIBRARY_DIRS="${{steps.install-boost.outputs.BOOST_ROOT}}/lib" -G "MinGW Makefiles" -B build
if: ${{matrix.COMPILER == 'mingw'}}
env:
BOOST_ROOT: ${{steps.install-boost.outputs.BOOST_ROOT}}
- name: Install arm64 compiler
run: sudo apt-get update && sudo apt-get install gcc-aarch64-linux-gnu g++-aarch64-linux-gnu -y
if: matrix.ARCH == 'aarch64'

- name: Configure CMake arm64
shell: bash
working-directory: test
run: cmake . -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DBUILD_ARM_BINARIES=1 -DBoost_LIBRARY_DIRS="${{steps.install-boost.outputs.BOOST_ROOT}}/lib" -B build
if: matrix.ARCH == 'aarch64'
env:
BOOST_ROOT: ${{steps.install-boost.outputs.BOOST_ROOT}}
- name: Configure CMake mingw
shell: bash
working-directory: test
run: cmake . -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DBoost_LIBRARY_DIRS="${{steps.install-boost.outputs.BOOST_ROOT}}/lib" -G "MinGW Makefiles" -B build
if: ${{matrix.COMPILER == 'mingw'}}
env:
BOOST_ROOT: ${{steps.install-boost.outputs.BOOST_ROOT}}

- name: Configure CMake
shell: bash
working-directory: test
run: cmake . -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DBoost_LIBRARY_DIRS="${{steps.install-boost.outputs.BOOST_ROOT}}/lib" -B build
if: ${{matrix.COMPILER != 'mingw' && matrix.ARCH != 'aarch64'}}
env:
BOOST_ROOT: ${{steps.install-boost.outputs.BOOST_ROOT}}
- name: Build
working-directory: test/build
shell: bash
run: cmake --build . --config $BUILD_TYPE
- name: Configure CMake arm64
shell: bash
working-directory: test
run: cmake . -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DBUILD_ARM_BINARIES=1 -DBoost_LIBRARY_DIRS="${{steps.install-boost.outputs.BOOST_ROOT}}/lib" -B build
if: matrix.ARCH == 'aarch64'
env:
BOOST_ROOT: ${{steps.install-boost.outputs.BOOST_ROOT}}

- name: Configure CMake
shell: bash
working-directory: test
run: cmake . -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DBoost_LIBRARY_DIRS="${{steps.install-boost.outputs.BOOST_ROOT}}/lib" -B build
if: ${{matrix.COMPILER != 'mingw' && matrix.ARCH != 'aarch64'}}
env:
BOOST_ROOT: ${{steps.install-boost.outputs.BOOST_ROOT}}
- name: Build
working-directory: test/build
shell: bash
run: cmake --build . --config $BUILD_TYPE
146 changes: 74 additions & 72 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,79 +1,81 @@
name: test

on:
workflow_dispatch:
push:
paths:
- ".github/workflows/test.yml"
- "dist/**"
- "action.yml"
pull_request:
paths:
- ".github/workflows/test-cmake.yml"
- "dist/**"
- "action.yml"
- "test/**"
workflow_dispatch:
push:
paths:
- '.github/workflows/test.yml'
- 'dist/**'
- 'action.yml'
pull_request:
paths:
- '.github/workflows/test-cmake.yml'
- 'dist/**'
- 'action.yml'
- 'test/**'

jobs:
build:
runs-on: ${{ matrix.os }}

strategy:
matrix:
os: [ubuntu-latest, windows-latest]

steps:
- uses: actions/checkout@v2
- name: Install boost
uses: ./
id: install-boost
with:
boost_version: 1.73.0
- name: List contents of boost directory
run: ls
working-directory: ${{ steps.install-boost.outputs.BOOST_ROOT }}
shell: bash
- run: echo "${{ steps.install-boost.outputs.BOOST_ROOT }}"
shell: bash
- run: echo "${{ steps.install-boost.outputs.BOOST_VER }}"
shell: bash
build:
runs-on: ${{ matrix.os }}

build-custom-install-dir-ubuntu:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: Install boost
uses: ./
id: install-boost
with:
boost_version: 1.73.0
boost_install_dir: '/home/runner'
- name: List contents of boost directory
run: ls
working-directory: ${{ steps.install-boost.outputs.BOOST_ROOT }}
shell: bash
- run: echo "${{ steps.install-boost.outputs.BOOST_ROOT }}"
shell: bash
- run: echo "${{ steps.install-boost.outputs.BOOST_VER }}"
shell: bash
strategy:
matrix:
os: [ubuntu-latest, windows-latest]

build-custom-install-dir-windows:
runs-on: windows-latest

steps:
- uses: actions/checkout@v2
- name: Install boost
uses: ./
id: install-boost
with:
boost_version: 1.73.0
boost_install_dir: 'C:/'
- name: List contents of boost directory
run: ls
working-directory: ${{ steps.install-boost.outputs.BOOST_ROOT }}
shell: bash
- run: echo "${{ steps.install-boost.outputs.BOOST_ROOT }}"
shell: bash
- run: echo "${{ steps.install-boost.outputs.BOOST_VER }}"
shell: bash
steps:
- uses: actions/checkout@v2
- name: Install boost
uses: ./
id: install-boost
with:
boost_version: 1.73.0
- name: List contents of boost directory
run: ls
working-directory: ${{ steps.install-boost.outputs.BOOST_ROOT }}
shell: bash
- run: echo "${{ steps.install-boost.outputs.BOOST_ROOT }}"
shell: bash
- run: echo "${{ steps.install-boost.outputs.BOOST_VER }}"
shell: bash

build-custom-install-dir-ubuntu:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: Install boost
uses: ./
id: install-boost
with:
boost_version: 1.73.0
boost_install_dir: '/home/runner'
cache: false
- name: List contents of boost directory
run: ls
working-directory: ${{ steps.install-boost.outputs.BOOST_ROOT }}
shell: bash
- run: echo "${{ steps.install-boost.outputs.BOOST_ROOT }}"
shell: bash
- run: echo "${{ steps.install-boost.outputs.BOOST_VER }}"
shell: bash

build-custom-install-dir-windows:
runs-on: windows-latest

steps:
- uses: actions/checkout@v2
- name: Install boost
uses: ./
id: install-boost
with:
boost_version: 1.73.0
boost_install_dir: 'C:/'
cache: false
- name: List contents of boost directory
run: ls
working-directory: ${{ steps.install-boost.outputs.BOOST_ROOT }}
shell: bash
- run: echo "${{ steps.install-boost.outputs.BOOST_ROOT }}"
shell: bash
- run: echo "${{ steps.install-boost.outputs.BOOST_VER }}"
shell: bash
5 changes: 5 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
dist/
node_modules/
.vscode/
test/
package-lock.json
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2020 Markus
Copyright (c) 2020 - 2022 MarkusJx

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
Loading