-
Notifications
You must be signed in to change notification settings - Fork 7
110 lines (101 loc) · 3.57 KB
/
rust.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
98
99
100
101
102
103
104
105
106
107
108
109
110
name: Build and test
on:
push:
pull_request:
defaults:
run:
shell: bash
env:
CARGO_TERM_COLOR: always
RUST_BACKTRACE: full
jobs:
is_duplicate_run:
name: Duplicate run?
runs-on: ubuntu-latest
outputs:
duplicate_run: ${{ steps.check_skip.outputs.should_skip }}
steps:
- uses: fkirc/skip-duplicate-actions@master
id: check_skip
with:
# Skip a concurrent run triggered by a pull_request event if there is
# already a run triggered by a push event.
concurrent_skipping: same_content_newer
# Cancel runs from outdated commits.
cancel_others: 'true'
# Do not skip push events. They are used by the push_docker job.
do_not_skip: '["push", "workflow_dispatch", "schedule"]'
clippy:
needs:
- is_duplicate_run
if: |
needs.is_duplicate_run.outputs.duplicate_run == 'false'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- run: sudo apt update && sudo apt install software-properties-common -y
- run: sudo apt-add-repository ppa:swi-prolog/stable -y && sudo apt update && sudo apt install swi-prolog-nox
- uses: actions-rs/clippy-check@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
args: --all-features -- -Dwarnings
build:
needs:
- is_duplicate_run
if: |
needs.is_duplicate_run.outputs.duplicate_run == 'false'
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
dmg: [no_dmg]
#include:
# - os: macos-latest
# dmg: dmg
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- name: Install SWI Prolog on Linux
if: ${{ matrix.os == 'ubuntu-latest' }}
run: |
sudo apt-add-repository ppa:swi-prolog/stable
sudo apt-get update
sudo apt install swi-prolog-nox
- name: Install LLVM and SWI Prolog on Windows
if: ${{ matrix.os == 'windows-latest' }}
run: choco install llvm swi-prolog
- name: Install SWI Prolog on MacOS from brew
if: ${{ matrix.os == 'macos-latest' && matrix.dmg == 'no_dmg' }}
run: brew install swi-prolog
- name: Install SWI Prolog on MacOS from dmg
if: ${{ matrix.os == 'macos-latest' && matrix.dmg == 'dmg' }}
run: bash .ci/install_swipl_dmg.sh
- name: Print information with swipl-info on posix
if: ${{ matrix.os != 'windows-latest' && matrix.dmg == 'no_dmg' }}
run: cargo run --bin print_swipl_info
- name: Print information with swipl-info on windows
if: ${{ matrix.os == 'windows-latest' }}
env:
SWIPL: C:\Program Files\swipl\bin\swipl.exe
run: cargo run --bin print_swipl_info
- name: Print information with swipl-info on osx with dmg
if: ${{ matrix.dmg == 'dmg' }}
env:
SWIPL: /Applications/SWI-Prolog.app/Contents/MacOS/swipl
run: cargo run --bin print_swipl_info
- name: Install cargo-swipl
run: cargo install --path ./cargo-swipl
- name: Run tests on posix
if: ${{ matrix.os != 'windows-latest' && matrix.dmg == 'no_dmg' }}
run: cargo swipl test --all-features
- name: Run tests on windows
if: ${{ matrix.os == 'windows-latest' }}
env:
SWIPL: C:\Program Files\swipl\bin\swipl.exe
LIBCLANG_PATH: C:\Program Files\LLVM\bin\
run: cargo swipl test --all-features
- name: Run tests on osx with dmg
if: ${{ matrix.dmg == 'dmg' }}
env:
SWIPL: /Applications/SWI-Prolog.app/Contents/MacOS/swipl
run: cargo swipl test --all-features