forked from MikeMcQuaid/strap
-
Notifications
You must be signed in to change notification settings - Fork 0
82 lines (62 loc) 路 2.08 KB
/
tests.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
name: GitHub Actions CI
on:
push:
branches:
- master
pull_request:
jobs:
tests:
runs-on: macos-11
steps:
- name: Set up Git repository
uses: actions/checkout@main
- run: brew test-bot --only-cleanup-before
- name: Cleanup macOS
run: |
sudo rm -rf /usr/local/bin/brew /usr/local/.??* \
/usr/local/Homebrew \
/Applications/Xcode.app /usr/local/Caskroom \
/Library/Developer/CommandLineTools
- name: Use newer Xcode
run: sudo xcode-select --switch /Applications/Xcode_13.0.app/Contents/Developer
- run: bin/strap.sh
env:
STRAP_CI: 1
STRAP_DEBUG: 1
- name: Rerun bin/strap.sh
run: bin/strap.sh
env:
STRAP_CI: 1
- run: brew config
- run: brew doctor
- name: Install Ruby dependencies
run: brew install gmp openssl@1.1 libyaml
- name: Set up Ruby
uses: ruby/setup-ruby@master
with:
bundler-cache: true
- run: script/bootstrap
- run: script/cibuild
- run: brew install --build-from-source --formula libfaketime
- run: brew install --cask orka
- run: brew install --formula shellcheck
- run: shellcheck bin/strap.sh
- run: bundle exec rubocop
docker:
runs-on: ubuntu-latest
steps:
- name: Set up Git repository
uses: actions/checkout@main
- name: Build Docker image
run: docker build --tag strap .
- name: Deploy the Docker image to GitHub Packages and Docker Hub
if: github.ref == 'refs/heads/master'
run: |
echo ${{secrets.GITHUB_TOKEN}} | \
docker login ghcr.io -u mikemcquaid --password-stdin
docker tag strap "ghcr.io/mikemcquaid/strap:master"
docker push "ghcr.io/mikemcquaid/strap:master"
echo ${{secrets.DOCKER_TOKEN}} | \
docker login -u mikemcquaid --password-stdin
docker tag strap "mikemcquaid/strap:master"
docker push "mikemcquaid/strap:master"