Repository navigation
127 lines (104 loc) · 3.61 KB
/
Copy pathci.yml
File metadata and controls
127 lines (104 loc) · 3.61 KB
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
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
name: CI
on:
push:
branches:
- master
pull_request:
jobs:
check:
name: Check
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v4
- name: Install stable toolchain
uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
- name: Run cargo check
uses: actions-rs/cargo@v1
with:
command: check
windows-gnu-release:
name: Release build (i686-pc-windows-gnu)
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v4
- name: Install stable toolchain
uses: dtolnay/rust-toolchain@stable
with:
targets: i686-pc-windows-gnu
- uses: Swatinem/rust-cache@v2
# Match release.yml's cross target and release profile: cargo check and
# native Windows tests do not catch cross-target linker failures.
- name: Run cargo build
uses: actions-rs/cargo@v1
with:
command: build
args: --release --locked --target i686-pc-windows-gnu
use-cross: true
lints:
name: Lints
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v4
- name: Install stable toolchain
uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt, clippy
- uses: Swatinem/rust-cache@v2
- name: Run cargo fmt
run: cargo fmt --all -- --check
- name: Run cargo clippy
run: cargo clippy --all-targets --all-features
installer:
name: Installer (POSIX sh)
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v4
# install.sh is published at railway.com/install.sh and reached through
# `curl … | sh`, so it has to run under whatever /bin/sh the host ships —
# dash on Debian/Ubuntu, busybox ash on Alpine — not just bash. Linting as
# dash catches bashisms before they reach users (see #319, #990).
- name: Shellcheck as dash
run: |
docker run --rm -v "$PWD:/w" -w /w koalaman/shellcheck:stable \
-s dash -S error install.sh agents.sh
- name: Installer version lookup regression tests
run: python3 tests/installer_version.py
# Leave the version unpinned to exercise the same lookup as public installs.
- name: Install under dash (Debian/Ubuntu /bin/sh)
run: |
docker run --rm -v "$PWD/install.sh:/install.sh:ro" ubuntu:24.04 sh -c '
set -e
apt-get update -qq && apt-get install -y -qq curl ca-certificates >/dev/null
SHELL=/bin/bash dash -s -- -y < /install.sh
~/.railway/bin/railway --version'
- name: Install under busybox ash (Alpine /bin/sh, no bash present)
run: |
docker run --rm -v "$PWD/install.sh:/install.sh:ro" alpine:3.20 sh -c '
set -e
apk add --no-cache curl >/dev/null
SHELL=/bin/ash sh -s -- -y < /install.sh
~/.railway/bin/railway --version'
test-plan:
name: Tests
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
runs-on: ${{ matrix.os }}
outputs:
matrix: ${{ steps.docker-prep.outputs.matrix }}
if: "!contains(github.event.head_commit.message, '(cargo-release)')"
steps:
- name: Checkout sources
uses: actions/checkout@v4
- name: Install stable toolchain
uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
- name: Run cargo test
uses: actions-rs/cargo@v1
with:
command: test