Skip to content

Commit

Permalink
feat: initial test version
Browse files Browse the repository at this point in the history
  • Loading branch information
saionaro committed May 11, 2024
1 parent d0aef11 commit d547979
Show file tree
Hide file tree
Showing 3 changed files with 55 additions and 31 deletions.
31 changes: 0 additions & 31 deletions .github/workflows/ci.yml

This file was deleted.

18 changes: 18 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: Release

on: [push]

jobs:
release:
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/master'
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
cache: "npm"
- run: npm ci
- run: npm run release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
37 changes: 37 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Test

on: [push]

env:
VERSION_WE_ARE_LOOKING_FOR: "3.14.16"

jobs:
release:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
cache: "npm"
- run: npm ci
- run: mkdir ./test_1
- run: |
echo '{"version": "${{ env.VERSION_WE_ARE_LOOKING_FOR }}"}' > ./test_1/package.json
- name: Test 1
id: package_ver
uses: ./
with:
path: ./test_1

- name: Check results
uses: actions/github-script@v7
env:
EXPECTED: ${{ env.VERSION_WE_ARE_LOOKING_FOR }}
RECEIVED: ${{ steps.package_ver.outputs.version }}
with:
script: |
const { EXPECTED, RECEIVED } = process.env;
if (RECEIVED !== EXPECTED)
core.setFailed(`Expected [${EXPECTED}], but got [${RECEIVED}]`)

0 comments on commit d547979

Please sign in to comment.