ci: change actions on #4
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: Rust | |
on: | |
push: | |
branches: ["master"] | |
pull_request: | |
branches: ["master"] | |
workflow_call: | |
inputs: | |
rust-version: | |
type: string | |
required: false | |
default: nightly | |
env: | |
CARGO_TERM_COLOR: always | |
jobs: | |
build: | |
runs-on: self-hosted | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up cargo cache | |
uses: actions/cache@v3 | |
continue-on-error: false | |
with: | |
path: | | |
~/.cargo/bin/ | |
~/.cargo/registry/index/ | |
~/.cargo/registry/cache/ | |
~/.cargo/git/db/ | |
target/ | |
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} | |
restore-keys: ${{ runner.os }}-cargo- | |
- name: Set up deno cache | |
uses: actions/cache@v3 | |
continue-on-error: false | |
with: | |
path: | | |
./node_modules | |
key: ${{ runner.os }}-deno-${{ hashFiles('**/package.json') }} | |
restore-keys: ${{ runner.os }}-deno- | |
- name: Set up dependencies | |
run: make deps | |
- name: Set up core | |
run: make v2ray | |
- name: Build Linux x86_64 binary | |
run: make release | |
- name: Build Windows x86_64 binary | |
run: make windows-gnu | |
- name: Build FreeBSD x86_64 binary | |
run: make freebsd | |
- name: Build Linux ARM64 binary | |
run: make aarch64-unknown-linux-musl | |
- name: Run tests | |
run: make test |