Skip to content
This repository was archived by the owner on Feb 24, 2025. It is now read-only.

Mark repository as deprecated (#268) #433

Mark repository as deprecated (#268)

Mark repository as deprecated (#268) #433

Workflow file for this run

name: 'build-test'
on: # rebuild any PRs and main branch changes
pull_request:
push:
branches:
- main
- 'releases/*'
jobs:
build: # make sure build/ci work properly
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Fetch version of node used in the repository
id: version
run: |
node_version="$(cat .tool-versions | grep "nodejs" | awk '{printf $2}')"
echo "version=${node_version}" >> $GITHUB_OUTPUT
- name: Install a consistent version of node
uses: actions/setup-node@v3
with:
node-version: ${{ steps.version.outputs.version }}
cache: 'npm'
- name: Run tests and build distributable
run: |
npm ci # Install dependencies directly from package-lock.json
npm run all # Runs tests and builds ./dist
- name: Check if there are changes
id: changes
run: echo "changed=$(git status --porcelain | wc -l)" >> $GITHUB_ENV
- if: steps.changes.outputs.changed != 0
uses: EndBug/add-and-commit@v7
with:
default_author: github_actions
add: '.'
message: 'Re-build distributable'
test: # make sure the action works on a clean machine without building
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Test Push
uses: ./
with:
action: push
api-token: ${{ secrets.LOKALISE_API_TOKEN }}
project-id: ${{ secrets.LOKALISE_TEST_PROJECT_PO }}
format: po
translation-directory: src/mock-messages/po/%LANG_ISO%
- name: Test Pull
uses: ./
with:
action: pull
api-token: ${{ secrets.LOKALISE_API_TOKEN }}
project-id: ${{ secrets.LOKALISE_TEST_PROJECT_PO }}
format: po
translation-directory: src/mock-messages/po/%LANG_ISO%