Skip to content

Commit

Permalink
#25: Basic x64 packaging and leia-test setup
Browse files Browse the repository at this point in the history
  • Loading branch information
pirog committed Aug 13, 2021
1 parent 5b1dbfb commit 74ae15b
Show file tree
Hide file tree
Showing 9 changed files with 684 additions and 28 deletions.
11 changes: 11 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Set the default behavior, in case people don't have core.autocrlf set.
* text=auto

# Declare files that will always have LF line endings on checkout.
*.js text eol=lf
*.sh text eol=lf
*.conf text eol=lf
*.cnf text eol=lf
*.ini text eol=lf
*.php text eol=lf
*.vcl text eol=lf
65 changes: 65 additions & 0 deletions .github/workflows/pr-basic-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
name: Basic Leia Tests

on:
pull_request:

jobs:
leia-tests:
runs-on: ${{ matrix.os }}
env:
TERM: xterm
strategy:
matrix:
os:
- macos-11
- ubuntu-20.04
- windows-2019
node-version:
- '14'
leia-tests:
- basics
steps:

# Install deps and cache
# Eventually it would be great if these steps could live in a separate YAML file
# that could be included in line to avoid code duplication
- name: Checkout code
uses: actions/checkout@v2
- name: Install node ${{ matrix.node-version }}
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node-version }}
- name: Get Yarn cache directory
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"
- name: Use Yarn cache
uses: actions/cache@v2
id: yarn-cache
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ matrix.node-version }}-${{ hashFiles('**/yarn.lock') }}
- name: Install Yarn dependencies
run: yarn install --prefer-offline --frozen-lockfile

# Package and verify CLI
- name: Package CLI
shell: bash
run: |
yarn build
ls -lsa dist/@lando
- name: Replace source CLI with packaged one
shell: bash
run: |
sudo mv ./dist/@lando/hyperdrive /usr/local/bin/hyperdrive
sudo chmod +x /usr/local/bin/hyperdrive
- name: Verify we can run the packaged CLI
shell: bash
run: |
which hyperdrive
hyperdrive version
# This block should eventually become use lando/actions-leia@v2
# - name: Generate tests
# run: yarn generate:tests
# - name: Run ${{ matrix.leia-tests }} tests
# run: yarn mocha --timeout 900000 ./test/${{ matrix.leia-tests }}.func.js
File renamed without changes.
2 changes: 1 addition & 1 deletion .github/workflows/pr-unit-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
strategy:
matrix:
os:
- macos-10.15
- macos-11
- ubuntu-20.04
- windows-2019
node-version:
Expand Down
36 changes: 30 additions & 6 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,31 @@
*-debug.log
*-error.log
/.nyc_output
/dist
/package-lock.json
/tmp
# Common sys files
.*.swp
._*
.git
.hg
.sign
.lock-wscript
.svn
.wafpickle-*
.DS_Store
.idea/
*.tar
*.jxp
*.sublime-*

# Logs
*.log
logs

# NPM files
node_modules

# Build dirs
build
dist

# Tests
test/split-file.txt
test/*.func.js
.nyc_output
coverage/
File renamed without changes.
File renamed without changes.
17 changes: 16 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,9 @@
"eslint-config-oclif": "^3.1",
"globby": "^10",
"mocha": "^5",
"nyc": "^14"
"nyc": "^14",
"pkg": "^5.3.1",
"rimraf": "^3.0.2"
},
"engines": {
"node": ">=14.0.0"
Expand All @@ -43,8 +45,21 @@
"@oclif/plugin-help"
]
},
"pkg": {
"outputPath": "dist",
"scripts": [
"bin/*.js",
"src/**/*.js"
],
"assets": [
"package.json",
"yarn.lock"
]
},
"repository": "lando/hyperdrive",
"scripts": {
"build": "yarn clean && yarn pkg -c package.json -t node14 bin/hyperdrive",
"clean": "rimraf dist",
"lint": "eslint .",
"test": "nyc mocha --forbid-only \"test/**/*.test.js\""
}
Expand Down
Loading

0 comments on commit 74ae15b

Please sign in to comment.