chore(ci): switch to GHA from circleci #19
Workflow file for this run
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
name: Test and Deploy | ||
on: | ||
pull_request: | ||
push: | ||
branches: | ||
- main | ||
jobs: | ||
build-linux-and-osx: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
- uses: actions/setup-node@v4 | ||
with: | ||
node-version: 18 | ||
cache: 'npm' | ||
- name: Install deps | ||
run: npm ci | ||
- name: Test | ||
run: make test | ||
- name: Build | ||
run: make build | ||
- name: Upload artifacts | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
if-no-files-found: error | ||
name: linux-and-osx-artifacts | ||
path: | | ||
coverage/ | ||
out/ | ||
package.json | ||
vendor/ | ||
build-windows: | ||
runs-on: windows-latest | ||
needs: build-linux | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
- uses: actions/setup-node@v4 | ||
with: | ||
node-version: 18 | ||
cache: 'npm' | ||
- name: Install deps | ||
run: | | ||
$ErrorActionPreference="Stop" | ||
node --version | ||
npm ci; npm test | ||
- name: Build | ||
run: | | ||
$ErrorActionPreference="Stop" | ||
npm run build; npm run build-windows | ||
- name: Upload artifacts | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
if-no-files-found: error | ||
name: windows-artifacts | ||
path: | | ||
coverage/ | ||
out/ | ||
test-linux: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
- uses: actions/setup-node@v4 | ||
with: | ||
node-version: 18 | ||
- uses: actions/download-artifact@v3 | ||
with: | ||
name: linux-and-osx-artifacts | ||
- name: Confirm that linux uploader binary is static | ||
run: (file out/codecov-linux | grep 'static') || exit ${?} | ||
- name: Remove test coverage files | ||
run: rm -rf *.coverage.txt coverage-report-test.json test/fixtures || echo | ||
- name: Run Linux binary -f (dry run) | ||
run: | | ||
out/codecov-linux -f /home/circleci/project/coverage/cobertura-coverage.xml -F linux -d -Z -v >> output_linux.txt | ||
- name: Run Linux binary auto-detect (dry run) | ||
run: | | ||
out/codecov-linux -F linux -d -Z >> output_linux.txt | ||
- run: | ||
name: Run Linux binary (upload) | ||
command: | | ||
out/codecov-linux -F linux -Z | ||
out/codecov-linux -F "-linux" -Z | ||
- name: Upload artifacts | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
if-no-files-found: error | ||
name: linux-and-osx-artifacts | ||
path: | | ||
output-linux.txt |