-
Notifications
You must be signed in to change notification settings - Fork 1
97 lines (96 loc) · 3.32 KB
/
test.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
name: test
on:
push:
branches: [main]
pull_request:
permissions:
contents: read
# Spend CI time only on latest ref: https://github.com/jonhoo/rust-ci-conf/pull/5
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
jobs:
required:
runs-on: ubuntu-latest
name: ubuntu / ${{ matrix.toolchain }}
strategy:
matrix:
toolchain: [nightly]
steps:
- uses: actions/checkout@v4
with:
submodules: true
- name: Restore cached downloaded game
id: cache-ashen
uses: actions/cache@v4
with:
path: rom
key: ${{ runner.os }}-ashen
- name: Download the game
if: steps.cache-ashen.outputs.cache-hit != 'true'
run: |
mkdir "rom"
cd "rom"
wget "https://archive.org/download/Nokia_N-Gage_Ashen_v1.0.6_Windows_Build/Ashen_v1.0.6_Windows_Build_Files.zip" -O "game.zip"
unzip "game.zip" -d "ashen"
unzip "ashen/Dawn1.06.zip" -d "ashen/game"
cp "ashen/game/Dawn/PackFile.Dat" "packfile.dat"
rm -rf "ashen" "ashen.zip"
- name: Install ${{ matrix.toolchain }}
uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ matrix.toolchain }}
- name: Generate lock file
if: hashFiles('Cargo.lock') == ''
run: cargo generate-lockfile
# https://twitter.com/jonhoo/status/1571290371124260865
- name: Test
run: cargo test --locked --all-features --all-targets
# https://github.com/rust-lang/cargo/issues/6669
- name: Doc tests
run: cargo test --locked --all-features --doc
- name: ROM - Deflate
run: cargo test --locked -- --ignored parse_rom_packfile
- name: ROM - Assets
run: cargo test --locked -- --ignored parse_rom_asset
env:
SKIP_TEST_WRITE: true
minimal:
runs-on: ubuntu-latest
name: ubuntu / nightly / direct-minimal-versions
steps:
- uses: actions/checkout@v4
with:
submodules: true
- name: Install nightly for -Z direct-minimal-versions
uses: dtolnay/rust-toolchain@nightly
- name: rustup default nightly
run: rustup default nightly
- name: cargo update -Z direct-minimal-versions
run: cargo update -Z direct-minimal-versions
- name: cargo test
run: cargo test --locked --all-features --all-targets
os-check:
runs-on: ${{ matrix.os }}
name: ${{ matrix.os }} / nightly
strategy:
fail-fast: false
matrix:
os: [macos-latest, windows-latest]
steps:
# if your project needs OpenSSL, uncommment this to fix Windows builds.
# it's commented out by default as tthe install command takes 5-10m.
# - run: echo "VCPKG_ROOT=$env:VCPKG_INSTALLATION_ROOT" | Out-File -FilePath $env:GITHUB_ENV -Append
# if: runner.os == 'Windows'
# - run: vcpkg install openssl:x64-windows-static-md
# if: runner.os == 'Windows'
- uses: actions/checkout@v4
with:
submodules: true
- name: Install nightly
uses: dtolnay/rust-toolchain@nightly
- name: cargo generate-lockfile
if: hashFiles('Cargo.lock') == ''
run: cargo generate-lockfile
- name: cargo test
run: cargo test --locked --all-features --all-targets