dotfiles/.github/workflows/test.yml
Dict Xiong b6ff4116c8
[refactor] clean, readable (#19)
* rebase zshrc, introduce DFS_NO_WALL

* improve ci

* improve ci

* improve ci

* update antigen url for DFS_NO_WALL

* OK

* improve ci for macos

* improve test.zsh

* staged

* fix ci

* fix ci

* use local vars

* introduce DFS_QUIET

* mass mod install.sh

* minor change

* set DFS_DEV=1 to prevent update

* debug: done -> fi

* fix DFS_DEV

* ubuntu.sh: set-mirror (ref: tuna)

* preinstall_check

* install.sh: -q to be quiet

* install.sh: -d to DFS_DEV

Co-authored-by: xiongdian.me <xiongdian.me@bytedance.com>
2022-11-05 19:45:21 +08:00

100 lines
2.3 KiB
YAML

name: test
on:
push: ~
workflow_dispatch: ~
jobs:
test-ubuntu:
name: test on ubuntu
runs-on: ubuntu-latest
steps:
- name: install dependencies
run: |
sudo apt update
sudo apt install -y git python3 python3-pip zsh curl inetutils-ping
sudo pip3 install requests
- name: checkout repo
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: install dfs
run: |
rev=`git rev-parse HEAD`
pwd
export DFS_NO_COMPILE=1 DFS_DEV=1
./install.sh
test `git rev-parse HEAD` = "$rev"
- name: antigen build
shell: /bin/zsh -ileo PIPE_FAIL {0}
run: |
echo $SHELL
antigen list
- name: run tests and reset
shell: /bin/zsh -ileo PIPE_FAIL {0}
run: |
source tools/test.zsh
antigen reset
rm -rf $ANTIGEN $HOME/.antigen
- name: antigen build with DFS_NO_WALL
shell: /bin/zsh -ileo PIPE_FAIL {0}
env:
DFS_NO_WALL: 1
run: |
echo $SHELL
antigen list
- name: run tests
shell: /bin/zsh -ileo PIPE_FAIL {0}
run: source tools/test.zsh
test-macos:
name: test on macos
runs-on: macos-12
steps:
- name: install dependencies
run: |
brew update
brew install git python3 zsh curl
sudo pip3 install requests
- name: checkout repo
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: install dfs
run: |
rev=`git rev-parse HEAD`
pwd
export DFS_NO_COMPILE=1 DFS_DEV=1
./install.sh
test `git rev-parse HEAD` = "$rev"
- name: antigen build
shell: /bin/zsh -ileo PIPE_FAIL {0}
run: |
echo $SHELL
antigen list
- name: run tests and reset
shell: /bin/zsh -ileo PIPE_FAIL {0}
run: |
source tools/test.zsh
antigen reset
rm -rf $ANTIGEN $HOME/.antigen
- name: antigen build with DFS_NO_WALL
shell: /bin/zsh -ileo PIPE_FAIL {0}
env:
DFS_NO_WALL: 1
run: |
echo $SHELL
antigen list
- name: run tests
shell: /bin/zsh -ileo PIPE_FAIL {0}
run: source tools/test.zsh