Skip to content

Commit

Permalink
Update CI
Browse files Browse the repository at this point in the history
  • Loading branch information
khvzak committed Aug 29, 2023
1 parent 58a6ffe commit de56e47
Showing 1 changed file with 42 additions and 72 deletions.
114 changes: 42 additions & 72 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,24 +7,21 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-20.04, macos-latest]
rust: [stable]
lua: [lua54, lua53, lua52, lua51, luajit]
os: [ubuntu-22.04, macos-latest]
lua: [lua54, lua53, lua52, lua51]
include:
- os: ubuntu-20.04
- os: ubuntu-22.04
target: x86_64-unknown-linux-gnu
- os: macos-latest
target: x86_64-apple-darwin
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@stable
with:
toolchain: ${{ matrix.rust }}
target: ${{ matrix.target }}
override: true
- name: Run ${{ matrix.lua }} tests
run: |
cargo build --features "${{ matrix.lua }},vendored"
cargo build --features "${{ matrix.lua }}"
(cd testcrate && cargo test --features ${{ matrix.lua }})
shell: bash

Expand All @@ -33,100 +30,73 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-20.04, macos-latest]
rust: [stable]
os: [ubuntu-22.04, macos-latest]
include:
- os: ubuntu-20.04
- os: ubuntu-22.04
target: x86_64-unknown-linux-gnu
- os: macos-latest
target: x86_64-apple-darwin
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@stable
with:
toolchain: ${{ matrix.rust }}
target: ${{ matrix.target }}
override: true
- name: Install dependencies (macos)
if: ${{ matrix.os == 'macos-latest' }}
run: |
brew install lua luarocks
luarocks make
shell: bash
- name: Install dependencies
if: ${{ matrix.os != 'macos-latest' }}
- name: Install dependencies (linux)
if: ${{ matrix.os == 'ubuntu-22.04' }}
run: |
sudo apt-get update
sudo apt-get install -y curl lua5.3 liblua5.3-dev unzip build-essential
curl -L -O https://luarocks.org/releases/luarocks-3.7.0.tar.gz
tar xpf luarocks-3.7.0.tar.gz && cd luarocks-3.7.0 && ./configure && make && sudo make install && cd .. && rm -rf luarocks-3.7.0*
sudo chown -R $UID /usr/local
luarocks make
sudo apt-get install -y lua5.1 liblua5.1-dev luarocks
luarocks-5.1 --local make
shell: bash
- name: Run module inside Lua
run: lua -l ryaml -e 'print(ryaml.encode({}))'
run: |
eval `luarocks path`
lua -e 'print(require("ryaml").encode({}))'
shell: bash

test_module_windows:
name: Test module on Windows
runs-on: windows-latest
strategy:
matrix:
rust: [stable]
include:
- os: windows-latest
target: x86_64-pc-windows-msvc
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
toolchain: ${{ matrix.rust }}
target: ${{ matrix.target }}
override: true
- name: Install dependencies
run: |
curl -L -O "https://sourceforge.net/projects/luabinaries/files/5.3.6/Tools%20Executables/lua-5.3.6_Win64_bin.zip"
unzip lua-5.3.6_Win64_bin.zip -d /c/lua
curl -L -O "https://sourceforge.net/projects/luabinaries/files/5.3.6/Windows%20Libraries/Dynamic/lua-5.3.6_Win64_dllw6_lib.zip"
unzip -n lua-5.3.6_Win64_dllw6_lib.zip -d /c/lua
curl -L -O https://luarocks.org/releases/luarocks-3.7.0-windows-64.zip
unzip -j luarocks-3.7.0-windows-64.zip -d /c/lua
mkdir /c/lua/bin /c/lua/lib
mv /c/lua/*.exe /c/lua/bin
mv /c/lua/lua53.dll /mingw64/bin
mv /c/lua/liblua53.a /c/lua/lib/lua53.lib
rm -rf lua-5.3.6* luarocks-3.7.0*
/c/lua/bin/luarocks --tree=/c/lua make
shell: bash
- name: Run module inside Lua
run: /c/lua/bin/lua53 -l ryaml -e 'print(ryaml.encode({}))'
shell: bash
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@stable
with:
target: ${{ matrix.target }}
- uses: ilammy/msvc-dev-cmd@v1
- uses: leafo/gh-actions-lua@v10
with:
luaVersion: 5.4.6
- name: Install luarocks
run: |
curl -L -O https://luarocks.org/releases/luarocks-3.9.2-windows-64.zip
unzip -j luarocks-3.9.2-windows-64.zip -d .lua/bin
rm -rf luarocks-3.*
cp .lua/lib/lua54.dll .lua/bin
shell: bash
- name: Build module
run: luarocks --tree .lua make
- name: Run module inside Lua
run: |
lua -e 'print(require("ryaml").encode({}))'
shell: bash

rustfmt:
name: Rustfmt
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@stable
with:
toolchain: stable
components: rustfmt
override: true
- run: cargo fmt -- --check

clippy:
name: Clippy check
runs-on: ubuntu-20.04
strategy:
matrix:
lua: [lua54, lua53, lua52, lua51, luajit]
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
toolchain: nightly
components: clippy
override: true
- uses: actions-rs/clippy-check@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
args: --features "${{ matrix.lua }},vendored"

0 comments on commit de56e47

Please sign in to comment.