Use Arturo action in CI workflows #7555
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: "Linux" | |
on: | |
push: | |
branches: | |
- 'master' | |
tags-ignore: | |
- '**' | |
pull_request: | |
paths-ignore: | |
- 'docs/*' | |
- '*.yml' | |
- '*.md' | |
- 'LICENSE' | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
defaults: | |
run: | |
shell: bash -l {0} | |
jobs: | |
build: | |
name: "Build & Test" | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: | |
- ubuntu-latest | |
version: | |
- mini | |
- full | |
- safe | |
arch: | |
#- x86 | |
- amd64 | |
#- arm | |
- arm64 | |
exclude: | |
- version: full | |
arch: x86 | |
- version: full | |
arch: arm | |
- version: full | |
arch: arm64 | |
- version: safe | |
arch: x86 | |
- version: safe | |
arch: arm | |
- version: safe | |
arch: arm64 | |
steps: | |
- name: "Checkout" | |
uses: actions/checkout@main | |
with: | |
submodules: recursive | |
- name: Get Date | |
id: get-date | |
run: echo "::set-output name=date::$(date "+%Y-%m-%d")" | |
shell: bash | |
- name: Cache ChooseNim | |
id: cache-choosenim | |
uses: actions/cache@v3 | |
with: | |
path: ~/.choosenim | |
key: ${{ matrix.os }}-choosenim-${{ steps.get-date.outputs.date }} | |
- name: Cache Nimble | |
id: cache-nimble | |
uses: actions/cache@v3 | |
with: | |
path: ~/.nimble | |
key: ${{ matrix.os }}-nimble-${{ hashFiles('*.nimble') }} | |
- name: Setup nim | |
uses: jiro4989/setup-nim-action@v1 | |
with: | |
nim-version: '2.x' | |
repo-token: ${{ secrets.GITHUB_TOKEN }} | |
- name: Install dependencies (mini / x86) | |
if: matrix.version == 'mini' && matrix.arch != 'arm' && matrix.arch != 'arm64' | |
run: | | |
sudo apt-get update | |
sudo apt-get install gcc-multilib g++-multilib | |
- name: Install dependencies (mini / arm) | |
if: matrix.version == 'mini' && (matrix.arch == 'arm' || matrix.arch == 'arm64') | |
run: | | |
sudo apt-get update | |
sudo apt-get install gcc-arm-linux-gnueabihf gcc-aarch64-linux-gnu | |
- name: Install dependencies (full) | |
if: matrix.version != 'mini' | |
run: | | |
sudo apt-get update | |
sudo apt-get install libgtk-3-dev libwebkit2gtk-4.0-dev libmpfr-dev | |
- name: Verify dependecies | |
run: | | |
nim --version | |
- name: Build Arturo | |
run: | | |
echo "${{ github.workspace }}/bin" >> $GITHUB_PATH | |
./build.nims build --mode ${{ matrix.version }} --arch ${{ matrix.arch }} --log | |
- name: Upload Artifacts | |
uses: 'actions/upload-artifact@v2' | |
with: | |
name: "arturo-${{matrix.version}}-${{matrix.arch}}-linux" | |
path: bin/arturo | |
- name: Run unit tests (mini) | |
if: matrix.arch == 'amd64' && (matrix.version == 'mini') | |
run: | | |
echo "${{ github.workspace }}/bin" >> $GITHUB_PATH | |
arturo tools/tester.art | |
- name: Run unit tests (full) | |
if: matrix.arch == 'amd64' && (matrix.version == 'full') | |
run: | | |
echo "${{ github.workspace }}/bin" >> $GITHUB_PATH | |
./bin/arturo tools/tester.art | |
./bin/arturo tools/unitt-tester.art |