ci: upgrade action and node version (#268) #686
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 workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node | |
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions | |
name: Node.js CI | |
on: | |
push: | |
branches: [ master ] | |
pull_request: | |
branches: [ master ] | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref_name }} | |
cancel-in-progress: true | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
strategy: | |
max-parallel: 1 | |
matrix: | |
node-version: [18, 20] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Use Node.js ${{ matrix.node-version }} | |
uses: actions/setup-node@v4 | |
with: | |
node-version: ${{ matrix.node-version }} | |
- uses: supercharge/[email protected] | |
with: | |
redis-version: 6 | |
- name: Install & Setup InfluxDB | |
run: | | |
cd /tmp | |
wget https://dl.influxdata.com/platform/nightlies/influx_nightly_linux_amd64.tar.gz | |
tar xvfz influx_nightly_linux_amd64.tar.gz | |
sudo cp influx_nightly_linux_amd64/influx /usr/local/bin/ | |
sudo cp influx_nightly_linux_amd64/influxd /usr/local/bin/ | |
influxd & | |
sleep 10 | |
- name: Setup InfluxDB user and data | |
run: | | |
influx setup \ | |
--username ci_user \ | |
--password password \ | |
--org dyne \ | |
--bucket dyne \ | |
--retention 0 \ | |
--token PO2t9KsbqN4j8mDeIXZ2uqvNtmfcUXRRe2umYZxN1tdVFFG6C93zXm4hudc03jhERsW3tdCmke0dVDLVcycTIw== \ | |
--force | |
influx write --bucket dyne --file test/fixtures/influxdb_data.lp | |
- run: yarn | |
- run: yarn build | |
- run: yarn test | |
- uses: codecov/codecov-action@v3 | |
with: | |
token: ${{ secrets.CODECOV_TOKEN }} | |
file: ./coverage/lcov.info | |
publish: | |
runs-on: ubuntu-latest | |
if: github.ref == 'refs/heads/master' | |
needs: build | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: "0" | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: 18.x | |
registry-url: 'https://registry.npmjs.org' | |
- run: git fetch --depth=1 origin +refs/tags/*:refs/tags/* | |
- run: yarn | |
- run: yarn add -W zenroom | |
- run: yarn build | |
- run: git update-index --assume-unchanged package.json | |
- name: Install lerna globally | |
run: npm install --global --loglevel=error [email protected] | |
- name: Authenticate with Registry and publish | |
run: | | |
yarn logout | |
echo "//registry.npmjs.org/:_authToken=$NODE_AUTH_TOKEN" > .npmrc | |
npm whoami | |
lerna publish --no-verify-access -c -y --pre-dist-tag next --preid $(git rev-parse --short HEAD) --force-publish=* | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} |