Hide Results #3
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: "Test" | |
on: | |
workflow_dispatch: | |
push: | |
jobs: | |
test: | |
name: "Test" | |
runs-on: ubuntu-latest | |
timeout-minutes: 5 | |
steps: | |
- name: "Checkout" | |
uses: actions/checkout@v4 | |
- name: "Test to JSON" | |
id: json | |
uses: ./ | |
with: | |
source: .github/test/test.env | |
dest: .github/test/results.json | |
- name: "Echo JSON" | |
run: | | |
echo '${{ steps.json.outputs.result }}' | |
cat .github/test/results.json | |
- name: "Test to Environment" | |
id: env | |
uses: ./ | |
with: | |
source: .github/test/test.json | |
dest: .github/test/results.env | |
type: "env" | |
- name: "Echo Environment" | |
run: | | |
echo '${{ steps.env.outputs.result }}' | |
cat .github/test/results.env | |
lint: | |
name: "Lint" | |
runs-on: ubuntu-latest | |
timeout-minutes: 5 | |
steps: | |
- name: "Checkout" | |
uses: actions/checkout@v4 | |
- name: "Setup Node" | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 20 | |
- name: "ESLint" | |
run: | | |
npm install | |
npm run lint | |
build: | |
name: "Build" | |
runs-on: ubuntu-latest | |
timeout-minutes: 5 | |
steps: | |
- name: "Checkout" | |
uses: actions/checkout@v4 | |
- name: "Setup Node" | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 20 | |
- name: "Build" | |
run: | | |
npm install | |
npm run build | |
- name: "Verify" | |
run: | | |
git status --porcelain dist/ | |
if [ ! -d "dist" ];then | |
echo "Missing dist directory, run: npm build" | |
exit 1 | |
fi | |
if [ -n "$(git status --porcelain dist)" ];then | |
echo "Build was not run, run: npm build" | |
exit 1 | |
fi |