瀏覽代碼

add github workflows for build, test and publishing

pull/2259/head
Tristan Sloughter 5 年之前
父節點
當前提交
a2a0b08e01
沒有發現已知的金鑰在資料庫的簽署中 GPG 金鑰 ID: AAB97DDECCEB8150
共有 2 個檔案被更改,包括 73 行新增0 行删除
  1. +29
    -0
      .github/workflows/main.yml
  2. +44
    -0
      .github/workflows/publish.yml

+ 29
- 0
.github/workflows/main.yml 查看文件

@ -0,0 +1,29 @@
name: Common Test
on:
pull_request:
branches:
- 'master'
push:
branches:
- 'master'
jobs:
build:
name: Test on OTP ${{ matrix.otp_version }} and ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
otp_version: [19, 20, 21, 22, 23]
os: [ubuntu-latest]
container:
image: erlang:${{ matrix.otp_version }}
steps:
- uses: actions/checkout@v1
- name: Compile
run: ./bootstrap
- name: CT tests
run: ./rebar3 ct

+ 44
- 0
.github/workflows/publish.yml 查看文件

@ -0,0 +1,44 @@
name: Publish
on:
release:
types: [published, prereleased]
jobs:
build:
name: Publish escript to release
runs-on: ubuntu-latest
container:
image: erlang:19
steps:
- uses: actions/checkout@v1
- name: Compile
run: ./bootstrap
- name: CT tests
run: ./rebar3 ct
- name: Upload Release Asset
id: upload-release-asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./rebar3
asset_name: rebar3
asset_content_type: application/zip
- name: Configure AWS credentials
if: "!github.event.release.prerelease"
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: us-east-1
- name: Copy rebar3 escript to S3
if: "!github.event.release.prerelease"
run: |
aws s3 sync ./rebar3 s3://rebar3

Loading…
取消
儲存