diff options
| author | jiro4989 <jiroron666@gmail.com> | 2020-05-30 14:05:45 +0000 |
|---|---|---|
| committer | jiro4989 <jiroron666@gmail.com> | 2020-05-30 20:29:50 +0000 |
| commit | c57d16e8d532d37669637fc7701440f1f20212d8 (patch) | |
| tree | a8aa4837fa8ee2949070eff4524e4823024cf16e | |
| parent | a7464ccdb303fb888cab3acc368a356dd8997d9d (diff) | |
| download | NiGui-c57d16e8d532d37669637fc7701440f1f20212d8.tar.gz NiGui-c57d16e8d532d37669637fc7701440f1f20212d8.zip | |
Add CI workflow
| -rw-r--r-- | .github/workflows/test.yml | 71 |
1 files changed, 71 insertions, 0 deletions
diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..34f4742 --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,71 @@ +name: test + +on: + push: + pull_request: + +jobs: + skip: + runs-on: ubuntu-latest + steps: + - run: echo "Skip job" + + before: + runs-on: ubuntu-latest + if: "! contains(github.event.head_commit.message, '[skip ci]')" + steps: + - run: echo "not contains '[skip ci]'" + + test: + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: + - ubuntu-latest + - macOS-latest + - windows-latest + nim_version: + - '1.2.0' + - 'stable' + needs: before + steps: + - uses: actions/checkout@v1 + + - name: Set cache-key + id: vars + run: | + if [[ ${{ matrix.nim_version }} == stable ]]; then + echo ::set-output name=cache-key::$(date +%Y-%m-%d) + else + echo ::set-output name=cache-key::${{ matrix.nim_version }} + fi + shell: bash + + - name: Print cache-key + run: echo cache-key = ${{ steps.vars.outputs.cache-key }} + + - name: Cache choosenim + id: cache-choosenim + uses: actions/cache@v1 + with: + path: ~/.choosenim + key: ${{ runner.os }}-choosenim-${{ steps.vars.outputs.cache-key }} + - name: Cache nimble + id: cache-nimble + uses: actions/cache@v1 + with: + path: ~/.nimble + key: ${{ runner.os }}-nimble-${{ hashFiles('*.nimble') }} + - uses: jiro4989/setup-nim-action@v1 + with: + nim-version: ${{ matrix.nim_version }} + + - name: Test examples + run: | + cd examples + for file in $(ls -v example_*nim); do + echo "=== test: $file ===" + nim c "$file" + echo "" + done + shell: bash |
