feat: insert image markdown directly #1208
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: Build and check | |
on: | |
push: | |
branches: | |
- '*' | |
pull_request_target: | |
types: | |
- opened | |
- synchronize | |
- reopened | |
- edited | |
env: | |
GITLAB_NPM_TOKEN: ${{secrets.GITLAB_NPM_TOKEN}} | |
jobs: | |
rust-lint: | |
permissions: read-all | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out | |
uses: actions/checkout@v3 | |
- name: Step rust toolchain | |
uses: actions-rs/toolchain@v1 | |
with: | |
profile: minimal | |
override: true | |
toolchain: nightly-2023-06-09 | |
components: rustfmt, clippy | |
- name: Setup rust cache | |
uses: Swatinem/rust-cache@v2 | |
with: | |
workspaces: "rs" | |
- name: Fmt | |
working-directory: rs | |
run: cargo fmt | |
- name: Clippy | |
working-directory: rs | |
run: cargo clippy | |
- name: Test | |
working-directory: rs | |
run: cargo test --verbose | |
- name: Test release | |
working-directory: rs | |
run: cargo test --verbose --release | |
node-lint: | |
permissions: read-all | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out | |
uses: actions/checkout@v3 | |
with: | |
ref: ${{ github.event.pull_request.head.sha }} | |
- name: Setup node.js | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 20.x | |
cache: 'npm' | |
- name: Step rust toolchain | |
uses: actions-rs/toolchain@v1 | |
with: | |
profile: minimal | |
override: true | |
toolchain: nightly-2023-06-09 | |
- name: Setup wasm-pack | |
run: curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh | |
- name: Setup rust cache | |
uses: Swatinem/rust-cache@v2 | |
with: | |
workspaces: "rs" | |
- name: Build wasm | |
run: ./build-wasm.sh | |
- name: Install | |
run: npm ci | |
- name: Lint | |
run: npm run lint | |
- name: Test | |
run: npm run test:unit | |
package: | |
strategy: | |
matrix: | |
include: | |
- os: windows-latest | |
platform: win32 | |
arch: x64 | |
npm_config_arch: x64 | |
# - os: windows-latest | |
# platform: win32 | |
# arch: ia32 | |
# npm_config_arch: ia32 | |
# - os: windows-latest | |
# platform: win32 | |
# arch: arm64 | |
# npm_config_arch: arm | |
- os: ubuntu-latest | |
platform: linux | |
arch: x64 | |
npm_config_arch: x64 | |
# - os: ubuntu-latest | |
# platform: linux | |
# arch: arm64 | |
# npm_config_arch: arm64 | |
# - os: ubuntu-latest | |
# platform: linux | |
# arch: armhf | |
# npm_config_arch: arm | |
# - os: ubuntu-latest | |
# platform: alpine | |
# arch: x64 | |
# npm_config_arch: x64 | |
- os: macos-latest | |
platform: darwin | |
arch: x64 | |
npm_config_arch: x64 | |
# - os: macos-latest | |
# platform: darwin | |
# arch: arm64 | |
# npm_config_arch: arm64 | |
runs-on: ${{ matrix.os }} | |
needs: [ rust-lint, node-lint ] | |
env: | |
npm_config_arch: ${{ matrix.npm_config_arch }} | |
steps: | |
- name: Check out | |
uses: actions/checkout@v3 | |
with: | |
ref: ${{ github.event.pull_request.head.sha }} | |
- name: Setup node.js | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 20.x | |
cache: 'npm' | |
- name: Step rust toolchain | |
uses: actions-rs/toolchain@v1 | |
with: | |
profile: minimal | |
override: true | |
toolchain: nightly-2023-06-09 | |
- name: Setup wasm-pack | |
run: curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh | |
- name: Setup rust cache | |
uses: Swatinem/rust-cache@v2 | |
with: | |
workspaces: "rs" | |
- name: NPM install | |
run: npm ci | |
- name: Build wasm | |
run: wasm-pack build rs --target=nodejs --out-dir ../src/wasm | |
- name: Build node | |
env: | |
CLIENTID: ${{ secrets.OAUTHCLIENTID }} | |
CLIENTSECRET: ${{ secrets.OAUTHCLIENTSECRET }} | |
run: | | |
npm run package | |
- name: Version | |
id: version | |
shell: bash | |
run: echo "VERSION=1.0.0-beta.$(date +%s)" >> $GITHUB_OUTPUT | |
- name: Target | |
id: target | |
shell: bash | |
run: echo "TARGET=${{ matrix.platform }}-${{ matrix.arch }}" >> $GITHUB_OUTPUT | |
- name: Package | |
run: | | |
npx @vscode/vsce package --pre-release --target ${{ steps.target.outputs.TARGET }} --no-update-package-json --no-git-tag-version ${{ steps.version.outputs.VERSION }} | |
- name: Upload artifact | |
uses: actions/upload-artifact@v3 | |
with: | |
name: ${{ steps.target.outputs.TARGET }} | |
path: '*.vsix' |