forked from cryptogarageinc/cfd-dlc-js
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: switch from circleci to gh actions
- Loading branch information
1 parent
6610635
commit eaf513e
Showing
6 changed files
with
219 additions
and
146 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,205 @@ | ||
name: CI | ||
|
||
on: | ||
push: | ||
branches: | ||
- '**' | ||
pull_request: | ||
branches: | ||
- '**' | ||
workflow_dispatch: | ||
|
||
jobs: | ||
lint: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Install Node.js | ||
uses: actions/setup-node@v2 | ||
with: | ||
node-version: 'lts/*' | ||
- run: npm ci | ||
- run: npm run tslint_check | ||
|
||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Install Node.js | ||
uses: actions/setup-node@v2 | ||
with: | ||
node-version: 'lts/*' | ||
- run: npm ci | ||
- run: npm run cmake_all | ||
- name: Persist workspace | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: workspace | ||
path: . | ||
|
||
test: | ||
runs-on: ubuntu-latest | ||
needs: build | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Download workspace | ||
uses: actions/download-artifact@v3 | ||
with: | ||
name: workspace | ||
- name: Install Docker | ||
run: | | ||
sudo apt-get remove -y docker docker-engine docker.io containerd runc | ||
sudo apt-get update | ||
sudo apt-get install -y \ | ||
ca-certificates \ | ||
curl \ | ||
gnupg \ | ||
lsb-release | ||
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg | ||
echo \ | ||
"deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu \ | ||
$(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null | ||
sudo apt-get update | ||
sudo apt-get install -y docker-ce docker-ce-cli containerd.io | ||
- name: Run tests in Docker | ||
run: | | ||
docker pull ghcr.io/cryptogarageinc/elements-testing:v0.1.0 | ||
docker run --rm -v ${{ github.workspace }}:/workspace -w /workspace ghcr.io/cryptogarageinc/elements-testing:v0.1.0 /bin/bash -c " | ||
npm ci && | ||
npm run test_report | ||
" | ||
- name: Store test results | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: jest-reports | ||
path: ./reports/jest | ||
|
||
integration: | ||
runs-on: ubuntu-latest | ||
needs: build | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Download workspace | ||
uses: actions/download-artifact@v3 | ||
with: | ||
name: workspace | ||
- name: Install Docker | ||
run: | | ||
sudo apt-get remove -y docker docker-engine docker.io containerd runc | ||
sudo apt-get update | ||
sudo apt-get install -y \ | ||
ca-certificates \ | ||
curl \ | ||
gnupg \ | ||
lsb-release | ||
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg | ||
echo \ | ||
"deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu \ | ||
$(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null | ||
sudo apt-get update | ||
sudo apt-get install -y docker-ce docker-ce-cli containerd.io | ||
- name: Run integration tests in Docker | ||
run: | | ||
docker pull ghcr.io/cryptogarageinc/elements-testing:v0.1.0 | ||
docker run --rm -v ${{ github.workspace }}:/workspace -w /workspace ghcr.io/cryptogarageinc/elements-testing:v0.1.0 /bin/bash -c " | ||
npm ci && | ||
./integration_tests/__tests__/start-bitcoind.sh $(pwd) 'integration_tests' && | ||
sleep 3 && | ||
npm run test_integration | ||
" | ||
- name: Store integration artifacts | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: integration-artifacts | ||
path: ./build_coverage/lcov_cfddlc_output | ||
- name: Store integration test results | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: integration-reports | ||
path: ./reports/integration | ||
|
||
prebuild-linux: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Install Node.js | ||
uses: actions/setup-node@v2 | ||
with: | ||
node-version: 'lts/*' | ||
- run: touch .no-postinstall | ||
- run: npm ci | ||
- run: npm run-script prebuild_all | ||
- name: Store Linux prebuild artifacts | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: prebuilds-linux | ||
path: ./prebuilds | ||
|
||
prebuild-windows: | ||
runs-on: windows-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Install Node.js | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: '20.x' | ||
|
||
- name: Install Git | ||
shell: powershell | ||
run: | | ||
choco install git --params "/GitAndUnixToolsOnPath" | ||
- name: Install CMake | ||
shell: powershell | ||
run: | | ||
choco install cmake --installargs '"ADD_CMAKE_TO_PATH=System"' | ||
- name: Verify CMake, Git, and Bash installation | ||
shell: powershell | ||
run: | | ||
cmake --version | ||
git --version | ||
bash --version | ||
- name: Set npm script-shell to bash | ||
shell: powershell | ||
run: | | ||
npm config set script-shell "bash.exe" | ||
- name: Run npm ci | ||
shell: bash | ||
run: | | ||
npm ci | ||
- name: Run prebuild script | ||
shell: bash | ||
run: | | ||
npm run-script prebuild_all | ||
- name: Store Windows prebuild artifacts | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: prebuilds-windows | ||
path: ./prebuilds | ||
|
||
release: | ||
runs-on: ubuntu-latest | ||
needs: [prebuild-linux, prebuild-windows] | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Download Linux prebuild artifacts | ||
uses: actions/download-artifact@v3 | ||
with: | ||
name: prebuilds-linux | ||
- name: Download Windows prebuild artifacts | ||
uses: actions/download-artifact@v3 | ||
with: | ||
name: prebuilds-windows | ||
- name: Install Node.js | ||
uses: actions/setup-node@v2 | ||
with: | ||
node-version: 'lts/*' | ||
- run: touch .no-postinstall | ||
- run: npm ci | ||
- run: npm run-script prebuild_upload_all -- ${{ secrets.GH_ACCESS_TOKEN }} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.