Skip to content

Commit

Permalink
CI: refactor gh-workflow;
Browse files Browse the repository at this point in the history
add intregration test
  • Loading branch information
boozook committed Mar 18, 2022
1 parent 5fe06b9 commit 1c7d4b8
Show file tree
Hide file tree
Showing 2 changed files with 135 additions and 44 deletions.
44 changes: 0 additions & 44 deletions .github/workflows/rust.yml

This file was deleted.

135 changes: 135 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,135 @@
name: Tests
on:
pull_request:
push:
branches: [main, master]

env:
RUSTUP_MAX_RETRIES: 10
CARGO_INCREMENTAL: 1
CARGO_NET_RETRY: 10
CARGO_TERM_COLOR: always

jobs:
build:
defaults:
run:
shell: bash

runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os:
- macos-latest
- ubuntu-latest
- windows-latest

steps:
- uses: actions/checkout@v2

- name: Tests
run: cargo test --verbose

format:
defaults:
run:
shell: bash

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: Install Rust toolchain
uses: actions-rs/toolchain@v1
with:
profile: minimal
components: rustfmt

- name: Check
run: cargo fmt -- --check

integration:
defaults:
run:
shell: bash

runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
# https://download.panic.com/playdate_sdk/PlaydateSDK-latest.pkg
# https://download-keycdn.panic.com/playdate_sdk/PlaydateSDK-#{version}.pkg
os:
- macos-latest
- ubuntu-latest
# - windows-latest
sdk:
- latest

steps:
- uses: actions/checkout@v2
- name: Install Rust toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: nightly
components: rust-src
target: thumbv7em-none-eabihf
profile: minimal
override: true

- name: Install
run: cargo install --path . --force

- name: Checkout Crankstart
uses: actions/checkout@v3
with:
repository: rtsuk/crankstart
path: crankstart

- name: install SDK (macos)
if: ${{ matrix.os == 'macos-latest' }}
run: |
curl -L --silent --show-error --fail "https://download.panic.com/playdate_sdk/PlaydateSDK-${{ matrix.sdk }}.pkg" -o sdk.pkg
sudo installer -store -pkg "sdk.pkg" -target /
cat ~/.Playdate/config
- name: install SDK (linux)
if: ${{ matrix.os == 'ubuntu-latest' }}
run: |
curl -L --silent --show-error --fail "https://download.panic.com/playdate_sdk/Linux/PlaydateSDK-${{ matrix.sdk }}.tar.gz" -o sdk.tar.gz
mkdir sdk
tar -zxf sdk.tar.gz -C sdk
cd sdk/*/
sudo ./setup.sh || true
echo "PLAYDATE_SDK_PATH=$PWD" >> $GITHUB_ENV
echo "$PWD/bin" >> $GITHUB_PATH
# echo "$PLAYDATE_SDK_PATH" > "$HOME/.Playdate/config"
- name: install SDK (windows)
if: ${{ matrix.os == 'windows-latest' }}
run: |
curl -L --silent --show-error --fail "https://download.panic.com/playdate_sdk/Windows/PlaydateSDK-${{ matrix.sdk }}.exe" -o sdk.exe
# TODO: install sdk.exe
./sdk.exe --quiet
- name: info
run: |
which pdc
pdc --version
# temp, remove when #8 merged
- run: cargo install cargo-xbuild

- name: Build Examples
env:
RUST_LOG: trace
run: |
cd crankstart
# build projects without graphical dependencies:
# hello world
crank build --release --example=hello_world
crank build --release --example=hello_world --device
# life game
crank build --release --example=life
crank build --release --example=life --device

0 comments on commit 1c7d4b8

Please sign in to comment.