Skip to content

Commit

Permalink
consume npm packages from run-cmake-vcpkg-action-libs version 0.14.1
Browse files Browse the repository at this point in the history
  • Loading branch information
lukka committed Sep 7, 2020
1 parent a39c2ee commit 2cca61a
Show file tree
Hide file tree
Showing 13 changed files with 3,326 additions and 2,862 deletions.
30 changes: 29 additions & 1 deletion .github/workflows/build-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,36 @@ jobs:
- uses: actions/setup-node@v1
with:
node-version: '12.x'
- uses: lukka/get-cmake@v2
# How to consume GitHub packages, from this message (!): https://github.community/t/download-from-github-package-registry-without-authentication/14407/35
# Inspired from here: https://github.com/jcansdale-test/npmrc-configurations/blob/master/.github/workflows/blank.yml
- name: Authenticate to GitHub Packages
run: |
echo "//npm.pkg.github.com/:_authToken=${{ secrets.GITHUB_TOKEN }}" > ~/.npmrc
echo "@${{ github.repository_owner }}:registry=https://npm.pkg.github.com/" >> ~/.npmrc
- run: |
npm install
npm run test
name: build and test
tests:
name: '${{ matrix.os }}: functional tests'
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
steps:
- name: checkout this action
uses: actions/checkout@v1
with:
submodules: true

- name: basic test for run-cmake
uses: ./
with:
cmakeGenerator: 'Ninja'
cmakeListsOrSettingsJson: 'CMakeListsTxtBasic'
cmakeListsTxtPath: '${{ github.workspace }}/__tests__/theAssets/CMakeLists.txt'
buildDirectory: '${{ runner.workspace }}/b/ninja/'

4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,6 @@ token.txt
*.tgz
build
__tests__/build Directory
__tests__/b
__tests__/b
!dist
.npmrc
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,15 @@ It is __highly recommended__ to [use vcpkg as a submodule](https://github.com/lu

# Cache/Restore the vcpkg's build artifacts.
- name: Run vcpkg
uses: lukka/run-vcpkg@v2
uses: lukka/run-vcpkg@v4
with:
# Response file stored in source control, it provides the list of ports and triplet(s).
vcpkgArguments: '@${{ env.vcpkgResponseFile }}'
# Location of the vcpkg as submodule of the repository.
vcpkgDirectory: '${{ github.workspace }}/vcpkg'

- name: 'Run CMake with Ninja'
uses: lukka/run-cmake@v2
uses: lukka/run-cmake@v3
with:
cmakeListsOrSettingsJson: CMakeListsTxtAdvanced
cmakeListsTxtPath: '${{ github.workspace }}/cmakesettings.json/CMakeLists.txt'
Expand Down
4 changes: 3 additions & 1 deletion __tests__/basic.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ describe('run-cmake tests', () => {
test('basic test for CMakeListsTxtAdvanced', () => {
process.env.INPUT_CMAKELISTSORSETTINGSJSON = 'CMakeListsTxtAdvanced';
process.env.INPUT_BUILDDIRECTORY = buildDirectory;
process.env.INPUT_CMAKEAPPENDEDARGS = "-GNinja"
process.env.INPUT_CMAKELISTSTXTPATH = path.join(assetDirectory, 'CMakeLists.txt');
process.env.INPUT_BUILDWITHCMAKE = 'true';
process.env.INPUT_USESHELL = 'true';
Expand All @@ -99,8 +100,9 @@ describe('run-cmake tests', () => {
test('basic test for CMakeSettingsJson', () => {
process.env.INPUT_CMAKELISTSORSETTINGSJSON = 'CMakeSettingsJson';
process.env.INPUT_BUILDDIRECTORY = buildDirectory;
// Avoid executing tests with VS generators because of: https://github.com/lukka/run-cmake/issues/26
process.platform === "win32" ?
process.env.INPUT_CONFIGURATIONREGEXFILTER = 'x64.*':
process.env.INPUT_CONFIGURATIONREGEXFILTER = 'x64-.*':
process.env.INPUT_CONFIGURATIONREGEXFILTER = '.*inux.*';
process.env.INPUT_CMAKESETTINGSJSONPATH = path.join(assetDirectory, 'CMakeSettings.json');
process.env.INPUT_BUILDWITHCMAKE = 'true';
Expand Down
2 changes: 1 addition & 1 deletion __tests__/theAssets/CMakeSettings.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
"ctestCommandArgs": ""
},
{
"name": "x64-Release-VS",
"name": "x64VS-Release",
"generator": "Visual Studio 16 2019 Win64",
"configurationType": "Release",
"inheritEnvironments": [
Expand Down
Loading

0 comments on commit 2cca61a

Please sign in to comment.