From cc758fd250a57761e72976a0fc185f3776de73ee Mon Sep 17 00:00:00 2001 From: Brett Mayson Date: Sun, 20 Oct 2024 01:21:01 +0000 Subject: [PATCH] whoops, left CI off --- .github/workflows/browser.yaml | 176 ++++++++++++++--------------- .github/workflows/build.yaml | 18 +-- .github/workflows/coverage.yaml | 104 ++++++++--------- .github/workflows/hls.yaml | 190 ++++++++++++++++---------------- .github/workflows/test.yaml | 96 ++++++++-------- 5 files changed, 292 insertions(+), 292 deletions(-) diff --git a/.github/workflows/browser.yaml b/.github/workflows/browser.yaml index ce3b0b25..79713f15 100644 --- a/.github/workflows/browser.yaml +++ b/.github/workflows/browser.yaml @@ -1,92 +1,92 @@ -# name: Browser +name: Browser -# on: -# push: -# branches: [ main ] -# pull_request: -# branches: [ main ] +on: + push: + branches: [ main ] + pull_request: + branches: [ main ] -# jobs: -# build-wasm: -# name: Build WASM -# runs-on: ubuntu-latest -# steps: -# - name: Checkout the source code -# uses: actions/checkout@master -# - name: Install wasm-pack -# run: cargo install wasm-pack -# - name: Rust Cache -# uses: Swatinem/rust-cache@v2 -# with: -# key: browser -# - name: Build -# run: wasm-pack build libs/paa --target web --features wasm -# - name: Rename -# run: | -# mv libs/paa/pkg/hemtt_paa_bg.wasm hemtt_paa_bg.wasm -# mv libs/paa/pkg/hemtt_paa.js hemtt_paa.js -# - name: Upload -# uses: actions/upload-artifact@v4 -# with: -# name: wasm -# path: | -# hemtt_paa_bg.wasm -# hemtt_paa.js +jobs: + build-wasm: + name: Build WASM + runs-on: ubuntu-latest + steps: + - name: Checkout the source code + uses: actions/checkout@master + - name: Install wasm-pack + run: cargo install wasm-pack + - name: Rust Cache + uses: Swatinem/rust-cache@v2 + with: + key: browser + - name: Build + run: wasm-pack build libs/paa --target web --features wasm + - name: Rename + run: | + mv libs/paa/pkg/hemtt_paa_bg.wasm hemtt_paa_bg.wasm + mv libs/paa/pkg/hemtt_paa.js hemtt_paa.js + - name: Upload + uses: actions/upload-artifact@v4 + with: + name: wasm + path: | + hemtt_paa_bg.wasm + hemtt_paa.js -# firefox: -# name: Firefox -# runs-on: ubuntu-latest -# needs: build-wasm -# steps: -# - name: Checkout the source code -# uses: actions/checkout@v4 -# - name: Download wasm -# uses: actions/download-artifact@v4 -# with: -# name: wasm -# path: wasm -# - name: Move wasm -# run: | -# mv wasm/hemtt_paa_bg.wasm browser/hemtt_paa_bg.wasm -# mv wasm/hemtt_paa.js browser/hemtt_paa.js -# - name: Rename manifest -# run: mv browser/manifest.firefox.json browser/manifest.json && rm browser/manifest.chrome.json -# - name: zip -# run: | -# cd browser -# zip -r firefox.zip * -# mv firefox.zip ../firefox.zip -# - name: Upload -# uses: actions/upload-artifact@v4 -# with: -# name: firefox -# path: firefox.zip + firefox: + name: Firefox + runs-on: ubuntu-latest + needs: build-wasm + steps: + - name: Checkout the source code + uses: actions/checkout@v4 + - name: Download wasm + uses: actions/download-artifact@v4 + with: + name: wasm + path: wasm + - name: Move wasm + run: | + mv wasm/hemtt_paa_bg.wasm browser/hemtt_paa_bg.wasm + mv wasm/hemtt_paa.js browser/hemtt_paa.js + - name: Rename manifest + run: mv browser/manifest.firefox.json browser/manifest.json && rm browser/manifest.chrome.json + - name: zip + run: | + cd browser + zip -r firefox.zip * + mv firefox.zip ../firefox.zip + - name: Upload + uses: actions/upload-artifact@v4 + with: + name: firefox + path: firefox.zip -# chrome: -# name: Chrome -# runs-on: ubuntu-latest -# needs: build-wasm -# steps: -# - name: Checkout the source code -# uses: actions/checkout@v4 -# - name: Download wasm -# uses: actions/download-artifact@v4 -# with: -# name: wasm -# path: wasm -# - name: Move wasm -# run: | -# mv wasm/hemtt_paa_bg.wasm browser/hemtt_paa_bg.wasm -# mv wasm/hemtt_paa.js browser/hemtt_paa.js -# - name: Rename manifest -# run: mv browser/manifest.chrome.json browser/manifest.json && rm browser/manifest.firefox.json -# - name: zip -# run: | -# cd browser -# zip -r chrome.zip * -# mv chrome.zip ../chrome.zip -# - name: Upload -# uses: actions/upload-artifact@v4 -# with: -# name: chrome -# path: chrome.zip + chrome: + name: Chrome + runs-on: ubuntu-latest + needs: build-wasm + steps: + - name: Checkout the source code + uses: actions/checkout@v4 + - name: Download wasm + uses: actions/download-artifact@v4 + with: + name: wasm + path: wasm + - name: Move wasm + run: | + mv wasm/hemtt_paa_bg.wasm browser/hemtt_paa_bg.wasm + mv wasm/hemtt_paa.js browser/hemtt_paa.js + - name: Rename manifest + run: mv browser/manifest.chrome.json browser/manifest.json && rm browser/manifest.firefox.json + - name: zip + run: | + cd browser + zip -r chrome.zip * + mv chrome.zip ../chrome.zip + - name: Upload + uses: actions/upload-artifact@v4 + with: + name: chrome + path: chrome.zip diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 626f0a8a..81366184 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -28,15 +28,15 @@ jobs: artifact: windows-x64 exe: hemtt.exe # Intel Mac - # - runner: macos-13 - # name: macos-x64 - # artifact: macos-x64 - # exe: hemtt - # # ARM Mac - # - runner: macos-latest - # name: macos-arm - # artifact: macos-arm64 - # exe: hemtt + - runner: macos-13 + name: macos-x64 + artifact: macos-x64 + exe: hemtt + # ARM Mac + - runner: macos-latest + name: macos-arm + artifact: macos-arm64 + exe: hemtt steps: - uses: actions/checkout@v4 - uses: dtolnay/rust-toolchain@stable diff --git a/.github/workflows/coverage.yaml b/.github/workflows/coverage.yaml index 74f27e06..55b81578 100644 --- a/.github/workflows/coverage.yaml +++ b/.github/workflows/coverage.yaml @@ -1,56 +1,56 @@ -# name: Coverage +name: Coverage -# on: -# push: -# branches: [main] -# pull_request: +on: + push: + branches: [main] + pull_request: -# permissions: -# contents: read +permissions: + contents: read -# env: -# CARGO_TERM_COLOR: always +env: + CARGO_TERM_COLOR: always -# jobs: -# coverage: -# name: ${{ matrix.os.name }} / tests -# runs-on: ${{ matrix.os.runner }} -# strategy: -# fail-fast: false -# matrix: -# os: -# - runner: ubuntu-latest -# name: ubuntu -# - runner: windows-latest -# name: windows -# steps: -# - uses: actions/checkout@v4 -# with: -# submodules: true -# - name: Install stable -# uses: dtolnay/rust-toolchain@stable -# with: -# components: llvm-tools-preview -# - uses: taiki-e/install-action@cargo-llvm-cov -# - uses: taiki-e/install-action@nextest -# - name: cargo generate-lockfile -# if: hashFiles('Cargo.lock') == '' -# run: cargo generate-lockfile -# - name: Install Arma 3 Tools -# if: startsWith(matrix.os.runner, 'windows') -# uses: arma-actions/arma3-tools@master -# with: -# toolsUrl: ${{ secrets.ARMA3_TOOLS_URL }} -# - name: cargo llvm-cov -# run: cargo llvm-cov nextest --locked --all-features --lcov --output-path out.lcov -# - name: Upload Coverage to GitHub Artifacts -# uses: actions/upload-artifact@v4 -# with: -# name: ${{ matrix.os.name }}-coverage -# path: out.lcov -# - name: Upload to codecov.io -# uses: codecov/codecov-action@v4 -# with: -# files: out.lcov -# fail_ci_if_error: true -# token: ${{ secrets.CODECOV_TOKEN }} +jobs: + coverage: + name: ${{ matrix.os.name }} / tests + runs-on: ${{ matrix.os.runner }} + strategy: + fail-fast: false + matrix: + os: + - runner: ubuntu-latest + name: ubuntu + - runner: windows-latest + name: windows + steps: + - uses: actions/checkout@v4 + with: + submodules: true + - name: Install stable + uses: dtolnay/rust-toolchain@stable + with: + components: llvm-tools-preview + - uses: taiki-e/install-action@cargo-llvm-cov + - uses: taiki-e/install-action@nextest + - name: cargo generate-lockfile + if: hashFiles('Cargo.lock') == '' + run: cargo generate-lockfile + - name: Install Arma 3 Tools + if: startsWith(matrix.os.runner, 'windows') + uses: arma-actions/arma3-tools@master + with: + toolsUrl: ${{ secrets.ARMA3_TOOLS_URL }} + - name: cargo llvm-cov + run: cargo llvm-cov nextest --locked --all-features --lcov --output-path out.lcov + - name: Upload Coverage to GitHub Artifacts + uses: actions/upload-artifact@v4 + with: + name: ${{ matrix.os.name }}-coverage + path: out.lcov + - name: Upload to codecov.io + uses: codecov/codecov-action@v4 + with: + files: out.lcov + fail_ci_if_error: true + token: ${{ secrets.CODECOV_TOKEN }} diff --git a/.github/workflows/hls.yaml b/.github/workflows/hls.yaml index ec262db6..a12d1a5b 100644 --- a/.github/workflows/hls.yaml +++ b/.github/workflows/hls.yaml @@ -1,99 +1,99 @@ -# name: Language Server +name: Language Server -# on: -# push: -# branches: [main] -# tags: -# - hls-v* -# pull_request: -# branches: [main] +on: + push: + branches: [main] + tags: + - hls-v* + pull_request: + branches: [main] -# permissions: -# contents: read +permissions: + contents: read -# jobs: -# build: -# name: ${{ matrix.os.name }} -# runs-on: ${{ matrix.os.runner }} -# strategy: -# fail-fast: false -# matrix: -# os: -# - runner: ubuntu-latest -# name: ubuntu -# artifact: linux-x64 -# exe: hemtt-language-server -# - runner: windows-latest -# name: windows -# artifact: windows-x64 -# exe: hemtt-language-server.exe -# steps: -# - uses: actions/checkout@v4 -# - uses: dtolnay/rust-toolchain@stable -# with: -# toolchain: stable -# - name: Rust Cache -# uses: Swatinem/rust-cache@v2 -# with: -# key: hls-${{ matrix.os.name }} -# - name: Compile -# run: | -# cd hls -# cargo build --release -# - name: Upload -# uses: actions/upload-artifact@v4 -# with: -# name: ${{ matrix.os.artifact }} -# path: target/release/${{ matrix.os.exe }} -# - name: Upload Language (Linux) -# if: startsWith(matrix.os.runner, 'ubuntu') -# uses: actions/upload-artifact@v4 -# with: -# name: languages -# path: hls/languages +jobs: + build: + name: ${{ matrix.os.name }} + runs-on: ${{ matrix.os.runner }} + strategy: + fail-fast: false + matrix: + os: + - runner: ubuntu-latest + name: ubuntu + artifact: linux-x64 + exe: hemtt-language-server + - runner: windows-latest + name: windows + artifact: windows-x64 + exe: hemtt-language-server.exe + steps: + - uses: actions/checkout@v4 + - uses: dtolnay/rust-toolchain@stable + with: + toolchain: stable + - name: Rust Cache + uses: Swatinem/rust-cache@v2 + with: + key: hls-${{ matrix.os.name }} + - name: Compile + run: | + cd hls + cargo build --release + - name: Upload + uses: actions/upload-artifact@v4 + with: + name: ${{ matrix.os.artifact }} + path: target/release/${{ matrix.os.exe }} + - name: Upload Language (Linux) + if: startsWith(matrix.os.runner, 'ubuntu') + uses: actions/upload-artifact@v4 + with: + name: languages + path: hls/languages -# package: -# name: Package -# runs-on: ubuntu-latest -# needs: build -# steps: -# - uses: actions/checkout@v4 -# - uses: actions/download-artifact@v4 -# with: -# name: linux-x64 -# path: linux -# - uses: actions/download-artifact@v4 -# with: -# name: windows-x64 -# path: windows -# - name: Set Executable -# run: | -# chmod +x linux/hemtt-language-server -# - name: Move Server -# run: | -# mv linux/hemtt-language-server hls/hemtt-language-server -# mv windows/hemtt-language-server.exe hls/hemtt-language-server.exe -# - name: Remove Existing Languages -# run: | -# rm -rf hls/languages -# - name: Download Languages -# uses: actions/download-artifact@v4 -# with: -# name: languages -# path: hls/languages -# - name: Package -# run: | -# cd hls -# npm install -# npm install -g @vscode/vsce -# vsce package -# - name: Upload -# uses: actions/upload-artifact@v4 -# with: -# name: hls -# path: hls/*.vsix -# - name: Publish -# if: startsWith(github.ref, 'refs/tags/') -# run: | -# cd hls -# vsce publish -p ${{ secrets.VSCE_TOKEN }} + package: + name: Package + runs-on: ubuntu-latest + needs: build + steps: + - uses: actions/checkout@v4 + - uses: actions/download-artifact@v4 + with: + name: linux-x64 + path: linux + - uses: actions/download-artifact@v4 + with: + name: windows-x64 + path: windows + - name: Set Executable + run: | + chmod +x linux/hemtt-language-server + - name: Move Server + run: | + mv linux/hemtt-language-server hls/hemtt-language-server + mv windows/hemtt-language-server.exe hls/hemtt-language-server.exe + - name: Remove Existing Languages + run: | + rm -rf hls/languages + - name: Download Languages + uses: actions/download-artifact@v4 + with: + name: languages + path: hls/languages + - name: Package + run: | + cd hls + npm install + npm install -g @vscode/vsce + vsce package + - name: Upload + uses: actions/upload-artifact@v4 + with: + name: hls + path: hls/*.vsix + - name: Publish + if: startsWith(github.ref, 'refs/tags/') + run: | + cd hls + vsce publish -p ${{ secrets.VSCE_TOKEN }} diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 042b4da6..0590a74c 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -1,52 +1,52 @@ -# name: Test +name: Test -# on: -# push: -# branches: [main] -# pull_request: +on: + push: + branches: [main] + pull_request: -# permissions: -# contents: read +permissions: + contents: read -# env: -# CARGO_TERM_COLOR: always +env: + CARGO_TERM_COLOR: always -# jobs: -# test: -# runs-on: ${{ matrix.os.runner }} -# name: ${{ matrix.os.name }} / ${{ matrix.toolchain }} -# strategy: -# fail-fast: false -# matrix: -# os: -# - runner: ubuntu-latest -# name: ubuntu -# - runner: windows-latest -# name: windows -# - runner: macos-13 -# name: macos-x64 -# - runner: macos-latest -# name: macos-arm -# toolchain: -# - stable -# - beta -# steps: -# - uses: actions/checkout@v4 -# with: -# submodules: true -# - name: Install Arma 3 Tools -# if: startsWith(matrix.os.runner, 'windows') -# uses: arma-actions/arma3-tools@master -# with: -# toolsUrl: ${{ secrets.ARMA3_TOOLS_URL }} -# - name: Install ${{ matrix.toolchain }} -# uses: dtolnay/rust-toolchain@stable -# with: -# toolchain: ${{ matrix.toolchain }} -# - uses: taiki-e/install-action@nextest -# - name: cargo generate-lockfile -# if: hashFiles('Cargo.lock') == '' -# run: cargo generate-lockfile -# # https://twitter.com/jonhoo/status/1571290371124260865 -# - name: cargo test --locked -# run: cargo nextest run --locked --all-features --all-targets +jobs: + test: + runs-on: ${{ matrix.os.runner }} + name: ${{ matrix.os.name }} / ${{ matrix.toolchain }} + strategy: + fail-fast: false + matrix: + os: + - runner: ubuntu-latest + name: ubuntu + - runner: windows-latest + name: windows + - runner: macos-13 + name: macos-x64 + - runner: macos-latest + name: macos-arm + toolchain: + - stable + - beta + steps: + - uses: actions/checkout@v4 + with: + submodules: true + - name: Install Arma 3 Tools + if: startsWith(matrix.os.runner, 'windows') + uses: arma-actions/arma3-tools@master + with: + toolsUrl: ${{ secrets.ARMA3_TOOLS_URL }} + - name: Install ${{ matrix.toolchain }} + uses: dtolnay/rust-toolchain@stable + with: + toolchain: ${{ matrix.toolchain }} + - uses: taiki-e/install-action@nextest + - name: cargo generate-lockfile + if: hashFiles('Cargo.lock') == '' + run: cargo generate-lockfile + # https://twitter.com/jonhoo/status/1571290371124260865 + - name: cargo test --locked + run: cargo nextest run --locked --all-features --all-targets