Skip to content

Merge pull request #574 from direnv/dependabot/npm_and_yarn/eslint-co… #1312

Merge pull request #574 from direnv/dependabot/npm_and_yarn/eslint-co…

Merge pull request #574 from direnv/dependabot/npm_and_yarn/eslint-co… #1312

Workflow file for this run

name: Build
on:
push:
branches:
- main
tags:
- "v*"
pull_request:
branches:
- main
jobs:
Build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup
uses: ./.github/actions/setup
- name: Set artifact name
run: |
PROJECT_NAME="$(node --print 'require("./package.json").name')"
case "$GITHUB_REF_TYPE" in
branch) PROJECT_VERSION="${GITHUB_SHA:0:7}" ;;
tag) PROJECT_VERSION="${GITHUB_REF_NAME:1}" ;;
esac
echo "artifact_name=$PROJECT_NAME-$PROJECT_VERSION.vsix" >> "$GITHUB_ENV"
- name: Build
run: |
npm run package -- --out "${{ env.artifact_name }}"
- name: Upload
uses: actions/upload-artifact@v3
with:
name: direnv-vscode
path: ${{ env.artifact_name }}
Lint:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup
uses: ./.github/actions/setup
- name: Lint
run: npm run lint
Test:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup
uses: ./.github/actions/setup
- name: Install direnv
run: |
case "$RUNNER_OS" in
macOs) brew install direnv ;;
Linux) sudo apt-get install --yes direnv ;;
esac
- name: Test
run: |
case "$RUNNER_OS" in
macOs) npm test ;;
Linux) xvfb-run -a npm test ;;
esac