From f476df31af4d6d4bbb6a34b3ca870564cfc39b83 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dundar=20G=C3=B6c?= Date: Sun, 6 Feb 2022 10:57:47 +0100 Subject: ci: rename workflows and jobs to be more consistent --- .../check-query-files-and-compilation.yml | 92 ---------------------- .github/workflows/test-queries.yml | 92 ++++++++++++++++++++++ .github/workflows/tests.yml | 2 +- .github/workflows/update-lockfile.yml | 55 +++++++++++++ .github/workflows/update-parsers-pr.yml | 55 ------------- .github/workflows/update-readme.yml | 4 +- 6 files changed, 150 insertions(+), 150 deletions(-) delete mode 100644 .github/workflows/check-query-files-and-compilation.yml create mode 100644 .github/workflows/test-queries.yml create mode 100644 .github/workflows/update-lockfile.yml delete mode 100644 .github/workflows/update-parsers-pr.yml (limited to '.github/workflows') diff --git a/.github/workflows/check-query-files-and-compilation.yml b/.github/workflows/check-query-files-and-compilation.yml deleted file mode 100644 index d2672972..00000000 --- a/.github/workflows/check-query-files-and-compilation.yml +++ /dev/null @@ -1,92 +0,0 @@ -name: Parser compilation and query file check - -on: - push: - branches: - - 'master' - pull_request: - types: [opened, synchronize, reopened, ready_for_review] - branches: - - 'master' - -# Cancel any in-progress CI runs for a PR if it is updated -concurrency: - group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.head_ref || github.sha }} - cancel-in-progress: true - -defaults: - run: - shell: bash - -jobs: - check_compilation_unix_like: - strategy: - fail-fast: false - matrix: - os: [ubuntu-latest, windows-2022, macos-latest] - cc: [ gcc, clang ] - nvim_tag: [ stable ] - exclude: - - os: ubuntu-latest - cc: clang - nvim_tag: stable - - - os: macos-latest - cc: gcc - nvim_tag: stable - - - os: windows-2022 - cc: clang - nvim_tag: stable - - include: - - os: windows-2022 - cc: cl - nvim_tag: stable - - - os: ubuntu-latest - cc: gcc - nvim_tag: nightly - - name: Parser compilation - runs-on: ${{ matrix.os }} - env: - CC: ${{ matrix.cc }} - NVIM: ${{ matrix.os == 'windows-2022' && 'Neovim\\bin\\nvim.exe' || 'nvim' }} - steps: - - uses: actions/checkout@v2 - - uses: ilammy/msvc-dev-cmd@v1 - - uses: actions/setup-node@v2 - - - name: Install and prepare Neovim - env: - NVIM_TAG: ${{ matrix.nvim_tag }} - TREE_SITTER_CLI_TAG: v0.20.4 - run: | - bash ./scripts/ci-install-${{ matrix.os }}.sh - - - name: Setup Parsers Cache - id: parsers-cache - uses: actions/cache@v2 - with: - path: | - ./parser/ - ~/AppData/Local/nvim/pack/nvim-treesitter/start/nvim-treesitter/parser/ - key: ${{ matrix.os }}-${{ matrix.cc }}-${{ matrix.nvim_tag }}-parsers-v1-${{ hashFiles('./lockfile.json', './lua/nvim-treesitter/parsers.lua', './lua/nvim-treesitter/install.lua', './lua/nvim-treesitter/shell_selectors.lua') }} - - - name: Compile parsers - run: $NVIM --headless -c "lua require'nvim-treesitter.install'.prefer_git=false" -c "TSInstallSync all" -c "q" - - - name: Post compile Windows - if: matrix.os == 'windows-2022' - run: cp -r ~/AppData/Local/nvim/pack/nvim-treesitter/start/nvim-treesitter/parser/* parser - - # NOTE: this is a temporary workaround to skip swift tests on ubuntu - # stable and should be removed once neovim 0.7 is released. - - if: matrix.os == 'ubuntu-latest' && matrix.nvim_tag == 'stable' - run: echo "SKIP_SWIFT_CHECK=TRUE" >> $GITHUB_ENV - - - name: Check query files - env: - SKIP_SWIFT_CHECK: ${{ env.SKIP_SWIFT_CHECK }} - run: $NVIM --headless -c "luafile ./scripts/check-queries.lua" -c "q" diff --git a/.github/workflows/test-queries.yml b/.github/workflows/test-queries.yml new file mode 100644 index 00000000..d4ec3305 --- /dev/null +++ b/.github/workflows/test-queries.yml @@ -0,0 +1,92 @@ +name: Test queries + +on: + push: + branches: + - 'master' + pull_request: + types: [opened, synchronize, reopened, ready_for_review] + branches: + - 'master' + +# Cancel any in-progress CI runs for a PR if it is updated +concurrency: + group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.head_ref || github.sha }} + cancel-in-progress: true + +defaults: + run: + shell: bash + +jobs: + check_compilation: + strategy: + fail-fast: false + matrix: + os: [ubuntu-latest, windows-2022, macos-latest] + cc: [ gcc, clang ] + nvim_tag: [ stable ] + exclude: + - os: ubuntu-latest + cc: clang + nvim_tag: stable + + - os: macos-latest + cc: gcc + nvim_tag: stable + + - os: windows-2022 + cc: clang + nvim_tag: stable + + include: + - os: windows-2022 + cc: cl + nvim_tag: stable + + - os: ubuntu-latest + cc: gcc + nvim_tag: nightly + + name: Parser compilation + runs-on: ${{ matrix.os }} + env: + CC: ${{ matrix.cc }} + NVIM: ${{ matrix.os == 'windows-2022' && 'Neovim\\bin\\nvim.exe' || 'nvim' }} + steps: + - uses: actions/checkout@v2 + - uses: ilammy/msvc-dev-cmd@v1 + - uses: actions/setup-node@v2 + + - name: Install and prepare Neovim + env: + NVIM_TAG: ${{ matrix.nvim_tag }} + TREE_SITTER_CLI_TAG: v0.20.4 + run: | + bash ./scripts/ci-install-${{ matrix.os }}.sh + + - name: Setup Parsers Cache + id: parsers-cache + uses: actions/cache@v2 + with: + path: | + ./parser/ + ~/AppData/Local/nvim/pack/nvim-treesitter/start/nvim-treesitter/parser/ + key: ${{ matrix.os }}-${{ matrix.cc }}-${{ matrix.nvim_tag }}-parsers-v1-${{ hashFiles('./lockfile.json', './lua/nvim-treesitter/parsers.lua', './lua/nvim-treesitter/install.lua', './lua/nvim-treesitter/shell_selectors.lua') }} + + - name: Compile parsers + run: $NVIM --headless -c "lua require'nvim-treesitter.install'.prefer_git=false" -c "TSInstallSync all" -c "q" + + - name: Post compile Windows + if: matrix.os == 'windows-2022' + run: cp -r ~/AppData/Local/nvim/pack/nvim-treesitter/start/nvim-treesitter/parser/* parser + + # NOTE: this is a temporary workaround to skip swift tests on ubuntu + # stable and should be removed once neovim 0.7 is released. + - if: matrix.os == 'ubuntu-latest' && matrix.nvim_tag == 'stable' + run: echo "SKIP_SWIFT_CHECK=TRUE" >> $GITHUB_ENV + + - name: Check query files + env: + SKIP_SWIFT_CHECK: ${{ env.SKIP_SWIFT_CHECK }} + run: $NVIM --headless -c "luafile ./scripts/check-queries.lua" -c "q" diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 03d1847b..98bb6874 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -15,7 +15,7 @@ concurrency: cancel-in-progress: true jobs: - check_compilation_unix_like: + check_compilation: strategy: fail-fast: false matrix: diff --git a/.github/workflows/update-lockfile.yml b/.github/workflows/update-lockfile.yml new file mode 100644 index 00000000..b712af41 --- /dev/null +++ b/.github/workflows/update-lockfile.yml @@ -0,0 +1,55 @@ +name: Update lockfile + +on: + schedule: + - cron: '30 6 * * *' + push: + branches: + - master + +jobs: + update-lockfile: + name: Update lockfile + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + with: + ref: master + + - name: Prepare + env: + NVIM_TAG: stable + run: | + wget https://github.com/stedolan/jq/releases/download/jq-1.6/jq-linux64 + mv ./jq-linux64 /tmp/jq + chmod +x /tmp/jq + wget https://github.com/neovim/neovim/releases/download/${NVIM_TAG}/nvim.appimage + chmod u+x nvim.appimage + mkdir -p ~/.local/share/nvim/site/pack/nvim-treesitter/start + ln -s $(pwd) ~/.local/share/nvim/site/pack/nvim-treesitter/start + + - name: Update parsers + env: + SKIP_LOCKFILE_UPDATE_FOR_LANGS: verilog + run: | + ./nvim.appimage --headless -c "luafile ./scripts/write-lockfile.lua" -c "q" + # Pretty print + cp lockfile.json /tmp/lockfile.json + cat /tmp/lockfile.json | /tmp/jq --sort-keys > lockfile.json + + - name: Commit changes + run: | + git config user.name "GitHub" + git config user.email "noreply@github.com" + git add lockfile.json + git commit -m "Update lockfile.json" || echo 'No commit necessary!' + git clean -xf + + - name: Create Pull Request + uses: peter-evans/create-pull-request@v3 + with: + commit-message: Update lockfile.json + title: Update lockfile.json + branch: update-lockfile-pr + base: ${{ github.head_ref }} + draft: true diff --git a/.github/workflows/update-parsers-pr.yml b/.github/workflows/update-parsers-pr.yml deleted file mode 100644 index 1af4913f..00000000 --- a/.github/workflows/update-parsers-pr.yml +++ /dev/null @@ -1,55 +0,0 @@ -name: Make Parser Update PR - -on: - schedule: - - cron: '30 6 * * *' - push: - branches: - - master - -jobs: - update-parsers: - name: Update parsers - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - with: - ref: master - - - name: Prepare - env: - NVIM_TAG: stable - run: | - wget https://github.com/stedolan/jq/releases/download/jq-1.6/jq-linux64 - mv ./jq-linux64 /tmp/jq - chmod +x /tmp/jq - wget https://github.com/neovim/neovim/releases/download/${NVIM_TAG}/nvim.appimage - chmod u+x nvim.appimage - mkdir -p ~/.local/share/nvim/site/pack/nvim-treesitter/start - ln -s $(pwd) ~/.local/share/nvim/site/pack/nvim-treesitter/start - - - name: Update parsers - env: - SKIP_LOCKFILE_UPDATE_FOR_LANGS: verilog - run: | - ./nvim.appimage --headless -c "luafile ./scripts/write-lockfile.lua" -c "q" - # Pretty print - cp lockfile.json /tmp/lockfile.json - cat /tmp/lockfile.json | /tmp/jq --sort-keys > lockfile.json - - - name: Commit changes - run: | - git config user.name "GitHub" - git config user.email "noreply@github.com" - git add lockfile.json - git commit -m "Update lockfile.json" || echo 'No commit necessary!' - git clean -xf - - - name: Create Pull Request - uses: peter-evans/create-pull-request@v3 - with: - commit-message: Update lockfile.json - title: Update lockfile.json - branch: update-lockfile-pr - base: ${{ github.head_ref }} - draft: true diff --git a/.github/workflows/update-readme.yml b/.github/workflows/update-readme.yml index 87c884cf..dba7ba26 100644 --- a/.github/workflows/update-readme.yml +++ b/.github/workflows/update-readme.yml @@ -1,4 +1,4 @@ -name: Check README parser info +name: Update README on: push: @@ -7,7 +7,7 @@ on: jobs: update-readme: - name: Check README parser info + name: Update README runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 -- cgit v1.2.3