mirror of
https://github.com/oh-my-fish/oh-my-fish.git
synced 2024-11-28 03:09:31 +08:00
Move build from TravisCI to GitHub Actions
This commit is contained in:
parent
85afe3c41d
commit
dff781c080
73
.github/workflows/build.yml
vendored
Normal file
73
.github/workflows/build.yml
vendored
Normal file
|
@ -0,0 +1,73 @@
|
|||
name: Build
|
||||
on: [push, pull_request]
|
||||
jobs:
|
||||
build:
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
os:
|
||||
- ubuntu-16.04
|
||||
- ubuntu-18.04
|
||||
- ubuntu-20.04
|
||||
- ubuntu-latest
|
||||
fish:
|
||||
- stock
|
||||
- 2
|
||||
- 3
|
||||
- brew
|
||||
exclude:
|
||||
- os: ubuntu-20.04
|
||||
fish: 2
|
||||
- os: ubuntu-latest
|
||||
fish: 2
|
||||
include:
|
||||
- os: macos-10.15
|
||||
fish: brew
|
||||
- os: macos-latest
|
||||
fish: brew
|
||||
runs-on: ${{ matrix.os }}
|
||||
steps:
|
||||
- name: Checkout the repository
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: Install Fish
|
||||
run: FISH_RELEASE=${{ matrix.fish }} tools/ci-install-fish.sh
|
||||
|
||||
- name: Install Oh My Fish!
|
||||
run: fish bin/install --verbose --offline --noninteractive --yes
|
||||
|
||||
- name: Run tests
|
||||
run: |
|
||||
tests/run.fish
|
||||
pushd pkg/fish-spec; fish -c 'fish-spec'; popd
|
||||
pushd pkg/omf; fish -c 'fish-spec'; popd
|
||||
|
||||
notify-success:
|
||||
needs: [build]
|
||||
if: success()
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Notify on Slack
|
||||
uses: rtCamp/action-slack-notify@ae4223259071871559b6e9d08b24a63d71b3f0c0
|
||||
env:
|
||||
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
|
||||
SLACK_ICON: false
|
||||
SLACK_COLOR: good
|
||||
SLACK_USERNAME: GitHub Actions
|
||||
SLACK_TITLE: Build Success
|
||||
SLACK_FOOTER: ""
|
||||
|
||||
notify-failure:
|
||||
needs: [build]
|
||||
if: failure()
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Notify on Slack
|
||||
uses: rtCamp/action-slack-notify@ae4223259071871559b6e9d08b24a63d71b3f0c0
|
||||
env:
|
||||
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
|
||||
SLACK_ICON: false
|
||||
SLACK_COLOR: danger
|
||||
SLACK_USERNAME: GitHub Actions
|
||||
SLACK_TITLE: Build Failure
|
||||
SLACK_FOOTER: ""
|
43
.travis.yml
43
.travis.yml
|
@ -1,43 +0,0 @@
|
|||
language: c
|
||||
dist: trusty
|
||||
|
||||
os:
|
||||
- linux
|
||||
- osx
|
||||
|
||||
addons:
|
||||
apt:
|
||||
packages:
|
||||
- bc
|
||||
- doxygen
|
||||
- expect
|
||||
- gettext
|
||||
- libncurses5-dev
|
||||
- tree
|
||||
|
||||
before_install:
|
||||
- tools/travis-install-git.sh
|
||||
- source tools/travis-github-pr-integration.sh
|
||||
- tools/travis-install-fish.sh
|
||||
|
||||
before_script:
|
||||
- tree -h
|
||||
- export
|
||||
- pushd bin; sha256sum -c install.sha256; popd
|
||||
- fish $TRAVIS_BUILD_DIR/bin/install --verbose --offline --noninteractive --yes
|
||||
|
||||
script:
|
||||
- tests/run.fish
|
||||
- pushd pkg/fish-spec; fish -c 'fish-spec'; popd
|
||||
- pushd pkg/omf; fish -c 'fish-spec'; popd
|
||||
|
||||
after_failure:
|
||||
- pwd
|
||||
- cd ~/.config/fish; tree -h; find . -type f | xargs cat
|
||||
|
||||
notifications:
|
||||
email:
|
||||
on_success: never
|
||||
on_failure: change
|
||||
slack:
|
||||
secure: fHR34H901zaBpUdm9BECQfocnPki8HdigH9CQxopvJ6Rm0WCLzCst4zPESAlO/Jb1t6OYtU6Goqmdq3yqzo8+moCrygrpMUtzIel/TDhkLzC2SIlmMdnw2/Xdwzisd/8QBVwu9ns8xJ2C4eegolNazNsc1Ow/wULaLwA7vUJrfcSmvYBepfe3MPSX/KLU3BBRhiTr3RhuzV+D1qQcSrAiWGVr4zWUiRAar6WD1D4athZO9OX33upBYpraGEa3sRWrUJjVv7KWMH566Y2MSAtd0NBgsF9dn3S5nKTXtfyGXt2gkykZ9Ag1B7B9AR9BHpn5UcvDdn7FZpEREfrllkDU8iG67RD7owyRl/T5jyWQecU2Q9Rlco5esEpbkY7sXmzwj2RVBGzsaVjxajZ+C7Ns2ogMcP8o+xqfcUASXjlJM2kJQRSenwx82Vq6uQ0vbhgKWBTQE1qsEkLDCthUxQ9eJ0/exoBp95wrZinilmEyps00oqmS40HEhB+JmuN2sGVWhpSczVDvVmdV+XSewLqfRnWtr2yhL8dR1sfVm2lJh3Dzik4BFUASByeBJnViU4dDilLlb4S3Dwk0XZh9HGwLs9ujNA3PT23uoRu4VRBQkIwXZE8v/qvf4/7w8IowofzezYcjwxkaqu1hNgTKNOkbgopV9RdwrUxy4f53S0l2jY=
|
26
tools/ci-install-fish.sh
Executable file
26
tools/ci-install-fish.sh
Executable file
|
@ -0,0 +1,26 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
set -o pipefail
|
||||
set -o errexit
|
||||
set -o nounset
|
||||
|
||||
if [[ $FISH_RELEASE = "brew" ]]; then
|
||||
brew update
|
||||
brew install fish
|
||||
else
|
||||
if [[ $FISH_RELEASE == "2" ]]; then
|
||||
REPO_PPA="ppa:fish-shell/release-2"
|
||||
else
|
||||
REPO_PPA="ppa:fish-shell/release-3"
|
||||
fi
|
||||
|
||||
if [[ $FISH_RELEASE != "stock" ]]; then
|
||||
sudo apt-add-repository -y $REPO_PPA
|
||||
fi
|
||||
|
||||
sudo apt-cache policy fish
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y fish
|
||||
fi
|
||||
|
||||
fish --version
|
|
@ -1,17 +0,0 @@
|
|||
# Return if we are not in a Pull Request
|
||||
if [[ "$TRAVIS_PULL_REQUEST" = "false" ]]; then
|
||||
export OMF_REPO_URI="https://github.com/$TRAVIS_REPO_SLUG"
|
||||
export OMF_REPO_BRANCH="$TRAVIS_BRANCH"
|
||||
return
|
||||
fi
|
||||
|
||||
GITHUB_PR_URL=https://api.github.com/repos/$TRAVIS_REPO_SLUG/pulls/$TRAVIS_PULL_REQUEST
|
||||
GITHUB_PR_BODY=$(curl -s $GITHUB_PR_URL 2> /dev/null)
|
||||
|
||||
if [[ $GITHUB_PR_BODY =~ \"ref\":\ *\"([a-zA-Z0-9_-]*)\" ]]; then
|
||||
export OMF_REPO_BRANCH=${BASH_REMATCH[1]}
|
||||
fi
|
||||
|
||||
if [[ $GITHUB_PR_BODY =~ \"repo\":.*\"clone_url\":\ *\"(https://github\.com/[a-zA-Z0-9_-]*/[a-zA-Z0-9_-]*\.git).*\"base\" ]]; then
|
||||
export OMF_REPO_URI=${BASH_REMATCH[1]}
|
||||
fi
|
|
@ -1,16 +0,0 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
set -o pipefail
|
||||
set -o errexit
|
||||
set -o nounset
|
||||
#set -o xtrace
|
||||
|
||||
# Return if we are not in a Pull Request
|
||||
if [[ "$TRAVIS_OS_NAME" = "linux" ]]; then
|
||||
sudo apt-add-repository -y ppa:fish-shell/release-2
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y fish
|
||||
else
|
||||
brew update
|
||||
brew install fish tree
|
||||
fi
|
|
@ -1,7 +0,0 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
if [[ "$TRAVIS_OS_NAME" = "linux" ]]; then
|
||||
sudo add-apt-repository -y ppa:git-core/ppa
|
||||
sudo apt-get update
|
||||
sudo apt-get install --only-upgrade -y git
|
||||
fi
|
Loading…
Reference in New Issue
Block a user