mirror of
https://github.com/neovim/neovim.git
synced 2025-02-25 18:55:25 -06:00
ci: create setup action
This deduplicates common operations.
This commit is contained in:
parent
76a30f2bd0
commit
ce6fefbab9
29
.github/actions/setup/action.yml
vendored
Normal file
29
.github/actions/setup/action.yml
vendored
Normal file
@ -0,0 +1,29 @@
|
|||||||
|
name: 'setup'
|
||||||
|
description: "Creates necessary setup for CI"
|
||||||
|
inputs:
|
||||||
|
install_flags:
|
||||||
|
description: 'Install script flags'
|
||||||
|
required: false
|
||||||
|
default: ''
|
||||||
|
runs:
|
||||||
|
using: "composite"
|
||||||
|
steps:
|
||||||
|
- name: Set $BIN_DIR
|
||||||
|
shell: bash
|
||||||
|
run: echo "$BIN_DIR" >> $GITHUB_PATH
|
||||||
|
|
||||||
|
- if: ${{ runner.os != 'Windows' }}
|
||||||
|
name: Set ulimit
|
||||||
|
shell: bash
|
||||||
|
run: ulimit -c unlimited
|
||||||
|
|
||||||
|
- if: ${{ runner.os == 'Windows' }}
|
||||||
|
run: .github/scripts/env.ps1
|
||||||
|
shell: pwsh
|
||||||
|
|
||||||
|
- name: Install dependencies
|
||||||
|
run: ./.github/scripts/install_deps.sh ${{ inputs.install_flags }}
|
||||||
|
shell: bash
|
||||||
|
|
||||||
|
- name: Cache
|
||||||
|
uses: ./.github/actions/cache
|
4
.github/workflows/api-docs.yml
vendored
4
.github/workflows/api-docs.yml
vendored
@ -18,11 +18,11 @@ jobs:
|
|||||||
pull-requests: write
|
pull-requests: write
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
|
- uses: ./.github/actions/setup
|
||||||
|
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
run: |
|
run: |
|
||||||
./.github/scripts/install_deps.sh
|
|
||||||
sudo apt-get install -y doxygen python3-msgpack
|
sudo apt-get install -y doxygen python3-msgpack
|
||||||
- uses: ./.github/actions/cache
|
|
||||||
|
|
||||||
- name: Generate docs
|
- name: Generate docs
|
||||||
run: |
|
run: |
|
||||||
|
10
.github/workflows/build.yml
vendored
10
.github/workflows/build.yml
vendored
@ -25,7 +25,7 @@ jobs:
|
|||||||
timeout-minutes: 20
|
timeout-minutes: 20
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
- run: ./.github/scripts/install_deps.sh
|
- uses: ./.github/actions/setup
|
||||||
- run: printf 'NVIM_BUILD_TYPE=Release\n' >> $GITHUB_ENV
|
- run: printf 'NVIM_BUILD_TYPE=Release\n' >> $GITHUB_ENV
|
||||||
|
|
||||||
- name: Build universal binary
|
- name: Build universal binary
|
||||||
@ -40,11 +40,7 @@ jobs:
|
|||||||
CMAKE_VERSION: '3.10.0'
|
CMAKE_VERSION: '3.10.0'
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
- run: ./.github/scripts/install_deps.sh
|
- uses: ./.github/actions/setup
|
||||||
|
|
||||||
- name: Set up environment
|
|
||||||
run: echo "$BIN_DIR" >> $GITHUB_PATH
|
|
||||||
|
|
||||||
|
|
||||||
- name: Install minimum required version of cmake
|
- name: Install minimum required version of cmake
|
||||||
run: |
|
run: |
|
||||||
@ -73,7 +69,7 @@ jobs:
|
|||||||
runs-on: ubuntu-22.04
|
runs-on: ubuntu-22.04
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
- run: ./.github/scripts/install_deps.sh
|
- uses: ./.github/actions/setup
|
||||||
|
|
||||||
- name: Build bundled dependencies
|
- name: Build bundled dependencies
|
||||||
run: make deps
|
run: make deps
|
||||||
|
9
.github/workflows/codeql.yml
vendored
9
.github/workflows/codeql.yml
vendored
@ -20,19 +20,14 @@ jobs:
|
|||||||
security-events: write
|
security-events: write
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout repository
|
- uses: actions/checkout@v4
|
||||||
uses: actions/checkout@v4
|
- uses: ./.github/actions/setup
|
||||||
|
|
||||||
- name: Install dependencies
|
|
||||||
run: ./.github/scripts/install_deps.sh
|
|
||||||
|
|
||||||
- name: Initialize CodeQL
|
- name: Initialize CodeQL
|
||||||
uses: github/codeql-action/init@v2
|
uses: github/codeql-action/init@v2
|
||||||
with:
|
with:
|
||||||
languages: cpp
|
languages: cpp
|
||||||
|
|
||||||
- uses: ./.github/actions/cache
|
|
||||||
|
|
||||||
- run: make
|
- run: make
|
||||||
|
|
||||||
- name: Perform CodeQL Analysis
|
- name: Perform CodeQL Analysis
|
||||||
|
4
.github/workflows/coverity.yml
vendored
4
.github/workflows/coverity.yml
vendored
@ -9,9 +9,7 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
|
- uses: ./.github/actions/setup
|
||||||
- name: Install dependencies
|
|
||||||
run: ./.github/scripts/install_deps.sh
|
|
||||||
|
|
||||||
- name: Download Coverity
|
- name: Download Coverity
|
||||||
run: |
|
run: |
|
||||||
|
4
.github/workflows/lintcommit.yml
vendored
4
.github/workflows/lintcommit.yml
vendored
@ -14,8 +14,8 @@ jobs:
|
|||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
ref: ${{ github.event.pull_request.head.sha }}
|
ref: ${{ github.event.pull_request.head.sha }}
|
||||||
|
|
||||||
- run: ./.github/scripts/install_deps.sh
|
- uses: ./.github/actions/setup
|
||||||
- uses: ./.github/actions/cache
|
|
||||||
- name: Build
|
- name: Build
|
||||||
run: |
|
run: |
|
||||||
cmake -S cmake.deps --preset ci
|
cmake -S cmake.deps --preset ci
|
||||||
|
27
.github/workflows/test.yml
vendored
27
.github/workflows/test.yml
vendored
@ -35,15 +35,13 @@ jobs:
|
|||||||
CC: clang
|
CC: clang
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
- run: ./.github/scripts/install_deps.sh
|
- uses: ./.github/actions/setup
|
||||||
- uses: ./.github/actions/cache
|
|
||||||
|
|
||||||
- name: Install stylua
|
- name: Install stylua
|
||||||
run: |
|
run: |
|
||||||
URL=$(curl -L https://api.github.com/repos/JohnnyMorganz/StyLua/releases/latest | jq -r '.assets[] | select(.name == "stylua-linux-x86_64.zip") | .browser_download_url')
|
URL=$(curl -L https://api.github.com/repos/JohnnyMorganz/StyLua/releases/latest | jq -r '.assets[] | select(.name == "stylua-linux-x86_64.zip") | .browser_download_url')
|
||||||
wget --directory-prefix="$BIN_DIR" "$URL"
|
wget --directory-prefix="$BIN_DIR" "$URL"
|
||||||
(cd "$BIN_DIR"; unzip stylua*.zip)
|
(cd "$BIN_DIR"; unzip stylua*.zip)
|
||||||
echo "$BIN_DIR" >> $GITHUB_PATH
|
|
||||||
|
|
||||||
- name: Build third-party deps
|
- name: Build third-party deps
|
||||||
run: |
|
run: |
|
||||||
@ -88,8 +86,7 @@ jobs:
|
|||||||
CC: clang
|
CC: clang
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
- run: ./.github/scripts/install_deps.sh
|
- uses: ./.github/actions/setup
|
||||||
- uses: ./.github/actions/cache
|
|
||||||
- name: Build third-party deps
|
- name: Build third-party deps
|
||||||
run: |
|
run: |
|
||||||
cmake -S cmake.deps --preset ci
|
cmake -S cmake.deps --preset ci
|
||||||
@ -124,13 +121,9 @@ jobs:
|
|||||||
CC: ${{ matrix.build.cc }}
|
CC: ${{ matrix.build.cc }}
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
- run: ./.github/scripts/install_deps.sh --test
|
- uses: ./.github/actions/setup
|
||||||
- uses: ./.github/actions/cache
|
with:
|
||||||
|
install_flags: "--test"
|
||||||
- name: Set up environment
|
|
||||||
run: |
|
|
||||||
ulimit -c unlimited
|
|
||||||
echo "$BIN_DIR" >> $GITHUB_PATH
|
|
||||||
|
|
||||||
- name: Create log dir
|
- name: Create log dir
|
||||||
run: mkdir -p "$LOG_DIR"
|
run: mkdir -p "$LOG_DIR"
|
||||||
@ -213,8 +206,7 @@ jobs:
|
|||||||
test: [functional, old]
|
test: [functional, old]
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
- uses: ./.github/actions/cache
|
- uses: ./.github/actions/setup
|
||||||
- run: .github/scripts/env.ps1
|
|
||||||
|
|
||||||
- name: Build deps
|
- name: Build deps
|
||||||
run: |
|
run: |
|
||||||
@ -281,8 +273,7 @@ jobs:
|
|||||||
CC: gcc
|
CC: gcc
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
- run: ./.github/scripts/install_deps.sh
|
- uses: ./.github/actions/setup
|
||||||
- uses: ./.github/actions/cache
|
|
||||||
|
|
||||||
- name: Build third-party deps
|
- name: Build third-party deps
|
||||||
run: |
|
run: |
|
||||||
@ -308,11 +299,11 @@ jobs:
|
|||||||
CC: gcc
|
CC: gcc
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
|
- uses: ./.github/actions/setup
|
||||||
|
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
run: |
|
run: |
|
||||||
sudo add-apt-repository ppa:neovim-ppa/stable
|
sudo add-apt-repository ppa:neovim-ppa/stable
|
||||||
./.github/scripts/install_deps.sh
|
|
||||||
sudo apt-get install -y \
|
sudo apt-get install -y \
|
||||||
libluajit-5.1-dev \
|
libluajit-5.1-dev \
|
||||||
libmsgpack-dev \
|
libmsgpack-dev \
|
||||||
@ -329,8 +320,6 @@ jobs:
|
|||||||
# Remove comments from packages once we start using these external
|
# Remove comments from packages once we start using these external
|
||||||
# dependencies.
|
# dependencies.
|
||||||
|
|
||||||
- uses: ./.github/actions/cache
|
|
||||||
|
|
||||||
- name: Build third-party deps
|
- name: Build third-party deps
|
||||||
run: |
|
run: |
|
||||||
cmake -S cmake.deps --preset external_deps
|
cmake -S cmake.deps --preset external_deps
|
||||||
|
Loading…
Reference in New Issue
Block a user